text stringlengths 1 1.04M | language stringclasses 25 values |
|---|---|
In this article, we showcase how to use a seven-point scoring system to consistently quantify changes to dopaminergic neuron dendrite morphology in C. elegans. This system is intended for analyses of dopaminergic neurodegeneration assays utilizing genetic, chemical, and age-based models of neurodegenerative disorders.
Dopamine neuron loss is involved in the pathology of Parkinson's Disease (PD), a highly prevalent neurodegenerative disorder affecting over 10 million people worldwide. Since many details about PD etiology remain unknown, studies investigating genetic and environmental contributors to PD are needed to discover methods of prevention, management, and treatment. Proper characterization of dopaminergic neuronal loss may be relevant not only to PD research, but to other increasingly prevalent neurodegenerative disorders.
There are established genetic and chemical models of dopaminergic neurodegeneration in the Caenorhabditis elegans model system, with easy visualization of neurobiology supported by the nematodes' transparency and invariant neuronal architecture. In particular, hermaphroditic C. elegans' dopaminergic neuron morphological changes can be visualized using strains with fluorescent reporters driven by cell-specific promotors such as the dat-1 dopamine transporter gene, which is expressed exclusively in their eight dopaminergic neurons.
With the capabilities of this model system and the appropriate technology, many laboratories have studied dopaminergic neurodegeneration. However, there is little consistency in the way the data is analyzed and much of the present literature uses binary scoring analyses that capture the presence of degeneration but not the full details of the progression of neuron loss. Here, we introduce a universal scoring system to assess morphological changes and degeneration in C. elegans' cephalic neuron dendrites. This seven-point scale allows for analysis across a full range of dendrite morphology, ranging from healthy neurons to complete dendrite loss, and considering morphological details including kinks, branching, blebs, and breaks. With this scoring system, researchers can quantify subtle age-related changes as well as more dramatic chemical-induced changes. Finally, we provide a practice set of images with commentary that can be used to train, calibrate, and assess the scoring consistency of researchers new to this method. This should improve within- and between- laboratory consistency, increasing rigor and reproducibility.
Parkinson's disease (PD) is an increasingly common neurodegenerative disease affecting up to 10 million individuals worldwide1. Males and older individuals are at a higher risk for developing PD; the average age of onset for the disease is 60 years, and PD incidence climbs from a 0.3% incidence in the general population to 3% in individuals over 80 years of age1,2. Although the details of PD pathology are not fully understood, this progressive disorder involves the loss of dopaminergic neurons in the substantia nigra region of the midbrain. Hypothesized mechanisms of this neuronal loss involve mitochondrial dysfunction, oxidative stress, and inflammation2. The causes and risk factors for the disease are still being explored, but involve a combination of environmental and genetic factors1. For example, studies have found positive associations between lifelong pesticide use and PD, as well as genetic susceptibility to familial PD1,3.
The C. elegans model system, originally developed in part for neurobiology research4, is well suited for evaluating dopaminergic neuron loss in vivo. Nass and colleagues pioneered the use of C. elegans for dopaminergic neurodegeneration5, and many groups have since adopted the worm as a successful model for PD and dopaminergic dysfunction6,7,8,9,10,11,12,13,14,15,16,17,18,19,20. C. elegans are good neurodegenerative disease models for many of the same reasons that they are such a popular model organism for other areas of biology; their transparency allows for in vivo study of cellular processes, genetic manipulation in worms is relatively quick and easy, they have a short generation time of about three days, and they are easy to maintain21. Most PD worm models fall into one of three categories: age-based models, chemical models, and genetic models. The ability to synchronize a population of worms allows for the study of age-related neurodegeneration for an age based-model of neurodegenerative diseases associated with aging, such as PD22. Chemical exposures inducing PD-like neuronal defects have been established using a variety of chemicals including 6-hydroxydopamine (6-OHDA), rotenone, and 1-methyl-4-phenyl-1,2,3,6-tetrahydropyridine (MPTP)22. Worms are also successfully used as genetic models of PD; strains with select neural gene knockouts can model various neurodegenerative diseases1,4. Combinations of genetic and environmental factors, or "gene-environment interactions," which likely play a major role in PD2,17,23,24,25,26,27,28, have been examined by several groups using C. elegans. Finally, age-related dopaminergic neurodegeneration has also been observed29,30. If using an appropriate neural transgenic strain in fluorescent imaging, any of these PD worm models may be used to study dopaminergic neurodegeneration.
Quantifying changes to neuronal morphology is a critical component of neurodegenerative research. In C. elegans, many fluorescent reporter strains have been used to visualize morphological changes and loss of neurons. Strains suitable for neuronal imaging feature a fluorescent protein associated with cell-specific promoters. For dopaminergic neurodegeneration assays, our laboratory has used the BY200 [vtIs1 (dat-1p::GFP, rol-6)] strain, which has a green fluorescent protein (GFP) tag in the dat-1 gene, expressed in the dopaminergic neurons. Note that the BY200's roller phenotype has a very low penetrance and is rarely observed. Other common strains used for this type of imaging include BY250 [dat-1p::GFP], BY273 [baEx18[dat-1p::GFP+dat-1p::WT α-syn]], BZ555 [egIs1 [dat-1p::GFP]], and several others available from the Caenorhabditis Genetics Center (CGC) or upon request from specific laboratories1,21,22,29. These strains typically allow for visualization of all three classes of dopaminergic neurons: cephalic (CEP), anterior deirid (ADE), and postdeirid (PDE) neurons. C. elegans does not naturally express the alpha synuclein protein, but strains such as BY273 have been engineered to express it. However, we note that the scoring system we present was developed using BY200, which does not express alpha synuclein, and would need to be validated with that strain (or any other new strain) prior to use. Additional dopaminergic neurons are present in males but are rarely considered because males normally comprise <1% of a C. elegans population. Here, we focus on the four CEP dopaminergic neurons found in the head region of C. elegans. This set of neurons is easily located under fluorescent microscopy, is present in both hermaphrodite and male worms, does not typically overlap with other areas of auto-fluorescence, and is commonly reported on in worm studies. Notably, though these neurons are not myelinated, the CEP dorsal (CEPD) neurons are directly exposed to the pseudocoelomic body fluid where as the CEP ventral neurons are not. A healthy set of CEP dendrites typically displays as relatively straight, uninterrupted lines. Degenerated dendrites may show any combination of irregularities and signs of damage, including pronounced dots called blebs along the line of the dendrite and breaks in the line of the dendrite. Examples of CEP neurons at varying levels of degeneration can be seen in Figure 1.
Although dopaminergic neurodegeneration is being studied by a growing number of C. elegans laboratories, there has been a large variation in analytical methods of quantifying dopaminergic neuron damage29,31,32,33,34. Many published studies have reported on the presence or absence of CEP soma with a binary scoring system of degenerative versus typical or wild type neurons31,32. These scoring methods can identify certain stressors that induce neurodegeneration but cannot quantify the details of the progression of more subtle neuronal damage, or easily detect differences between neurodegeneration as induced by unique chemicals or other variables. Additionally, scoring systems focused on the cell bodies may not be sensitive to less severe levels of damage or to neuronal damage affecting only part of the cell, such as the dendrite. Since the dendrite appears to have the largest range of consistently detectable morphologic changes in response to chemical stressors, we have selected them as the basis for our analysis. The scoring system we present here is modified from dendrite morphology based multi-point scales that have been previously used in our lab29,33. This system expands these five- and six-point scales into a seven-point scale to account for age-related morphological changes, such as higher expected numbers of kinks in older adult dendrites, and to differentiate between severe damage and complete dendrite loss. The purpose of introducing this scoring system is to provide the ability to capture a comprehensive picture of neurodegeneration at all levels of neuronal damage and provide a universal system to support consistency across C. elegan dopaminergic neurodegeneration research. Because scoring is inherently subjective, it is critical to maximize consistency between individuals scoring, and to blind the scorer to the identity of the images using manual blinding or an automatic blinding program35. To improve consistency, we present a series of training images and utilize JoVE's video capabilities to demonstrate our scoring system in detail. We recommend using a system that both permits automated blinded scoring and allows the scorer to quantify her or his scoring consistency by re-scoring a subset of images. This is particularly important when combining or comparing data from multiple scientists, or training scientists new to scoring.
- For each experimental group, pipette or pick 20 to 30 worms to an imaging platform compatible with the imaging microscope. Most common platforms include 2% agarose gel pads mounted on glass slides with a coverslip31 and 96-well plates containing well volumes at or less than 100 µL of liquid medium.
- Paralyze the worms by adding 30-90 mM sodium azide (NaN3), 2.5-8.5 mM levamisole HCl, or other paralyzing agent to the worms. If paralyzing in liquid, use a higher concentration of paralyzing agent than if paralyzing on agarose pads. Tap imaging platform gently to mix.
- Allow worms to paralyze completely.
NOTE: This may take several minutes.
- Locate worms' head regions under single-color GFP fluorescence using imaging microscope capable of taking z-stacks.
- Be mindful of exposure and aperture settings; avoid overexposure of dendrites and keep settings consistent across trials. Make the dendrites as bright as needed for clear visualization; this typically results in overexposure of the soma.
NOTE: Images included in this protocol were captured using 400x magnification.
- Be mindful of exposure and aperture settings; avoid overexposure of dendrites and keep settings consistent across trials. Make the dendrites as bright as needed for clear visualization; this typically results in overexposure of the soma.
- Scroll through the focus to find upper and lower bounds where the dendrites are clear. Set these as upper and lower bounds for a z-stack image capture.
- Click to capture z-stack images for each worm.
NOTE: All following steps may be performed at any time.
- For each z-stack, open the image file using either the microscope software or an external image analysis software, load the stack in the software, and compress the stack into a single flattened image.
- Blind images between and within treatment groups manually or using automatic blinding software.
- Work with one neuron image at a time. Choose one of the four CEP dendrites to assess for blebs, breaks, and irregularities including bends, kinks, and curves. Scoring from the left to right when the nose is at the top of the image is recommended to ensure repeatability in scoring.
- Using the following guidelines, assign one score value to the dendrite. See Figure 1 for representative scoring image examples.
1- irregular (kinks, curves, etc.)
- If multiple criteria are met within a single dendrite (i.e., kinks and blebs), assign the highest applicable score.
- Do not score dendrites that are not clearly visible, due to issues with image capture, overlapping with other dendrites, etc. If zooming in on a flattened z stack image, be mindful of enlarged pixels resembling false blebs.
- Repeat for each dendrite. Repeat for all images.
- Record all scores. Scores may be un-blinded at this time.
- Calculate the total number of dendrites in each treatment group assigned to each neurodegeneration score. Calculate the total number of scored dendrites in each treatment group.
- Divide the neurodegeneration score tallies by the total number of dendrites scored in the treatment group. Present data as a proportion of dendrites within a treatment group at each neurodegeneration score.
- Using a programming software or manually, run a chi-squared test for independence between all treatment group pairs to be compared. When appropriate, apply a Bonferroni correction of the p-value according to the number of compared experimental groups to account for multiple comparisons.
NOTE: This test will determine significant differences between two groups, but details of the type of difference must be qualified by eye.
- Select comparisons between experimental groups. This will vary based on experimental design.
NOTE: In our experiments, typically, controls are compared to their respective treatment groups, all controls are compared, and all treatments are compared.
- Select comparisons between experimental groups. This will vary based on experimental design.
- See Supplementary File 1 for a set of neuron images presenting across the full range of our scoring system with commentary and score key. This practice set is intended to train researchers new to this method and ensure inter-rater reliability.
- Instead of capturing z-stacks, complete scoring at the microscope, without saving or stacking images.
NOTE: This option reduces requirements for technology capabilities, but removes the option for creating an archive of neuron images to return to at a later time, requires manual blinding, and permits blinding only between and not within treatment groups.
- Instead of creating a single compressed image per stack, complete scoring by scrolling through the images of each z-stack.
NOTE: This option may be easier for some scorers and it reduces the risk for seeing false blebs on worms that moved during imaging and allows for scoring overlapping dendrites, but requires manual blinding and permits blinding only between and not within treatment groups.
The scoring system described here was used to assess neurodegeneration in L4 larval stage BY200 [vtIs1 (dat-1p::GFP, rol-6)] C. elegans after rotenone exposure. Results of this experiment are shown in Figure 2 and represent our scoring system's ability to detect and quantify variable levels of dopaminergic neuron damage. Rotenone is a naturally occurring electron transport chain complex I inhibitor used in some pesticides, piscicides, and insecticides36,37. Note that working with toxic chemicals such as rotenone is inherently dangerous, and all labs should comply with all use and disposal regulations set by their institutions. In this experiment, liquid rotenone exposures at two doses, 0.03 µM and 0.5 µM, along with a control group, were begun immediately following a 0.5 M sodium hydroxide/1% sodium hypochlorite lysis to harvest eggs38. Eggs hatched in complete K-medium33,39 with 0.25% dimethyl sulfoxide (DMSO), and worms remained in liquid for ~48 hours until mid-L4 larval stage, at which point they were removed from chemical exposure, and prepared, imaged, and, using Figure 1 as a reference, scored according to the protocol steps above. For the higher dose of 0.5 µM rotenone, eggs were harvested 24 hours in advance to account for a rotenone-induced developmental delay and ensure all worms were stage synchronized at the time of imaging.
Figure 2 further demonstrates how our laboratory visualizes data collected using this scoring system. In this figure, a dose-dependent neurodegeneration response can be appreciated, and the specific breakdown of the score distribution is displayed clearly. These particular results showcase how neuronal damage can present in different ways. For example, the 0.03 µM rotenone-exposed group has a decreased proportion of healthy neurons with a score of 0, as compared to the control group, yet also has a decreased proportion of 5 scores. Detecting this detail about the score distributions between experimental groups highlights the sensitivity of our seven-point scoring system. This data was analyzed for statistical significance according to the protocol, using a chi-squared test for independence with a Bonferroni correction.
Figure 1. Dopamine neuron morphological alteration and degeneration scoring system representative images. This consolidated chart contains examples of neurons at each score and is intended to be used as a reference for scoring. Here, each labelled score corresponds to the most damaged dendrite in each worm, as indicated by the arrow in each panel. These images were taken using the protocol described in this paper with BY200 C. elegans. Please see Supplementary File 1 for a set of scored images with commentary to be used for training those new to this scoring method. Please click here to view a larger version of this figure.
Figure 2. BY200 L4 dopamine neuron morphology and degeneration scores after rotenone exposure. This figure shows representative results analyzed using the scoring methods described here. The visualized greater proportions of damaged dopaminergic neurons with higher rotenone exposure concentrations were statistically analyzed using chi-squared tests for independence. Both rotenone treatment groups yielded statistically significant p-values when compared to the control group. Different letters indicate statistical difference. Please click here to view a larger version of this figure.
Supplementary File 1. Please click here to download this file.
Supplementary File 2. Please click here to download this file.
This protocol demonstrates how to use the seven-point scale developed in our laboratory to quantify levels of dopaminergic neuron morphologic alteration and degeneration in C. elegans. We created and shared this scale as a tool to standardize analysis of dopaminergic neurodegeneration work in worms. Recognizing the importance of studying pathways involved in highly prevalent neurodegenerative diseases, many investigators take advantage of the C. elegans model's suitability for neurobiology visualization to study neurodegeneration29,31,32,33. However, there has yet to be an effort to reduce the large variation in how neuron damage is quantified across neurodegeneration research in worms. The scoring system presented here is thus intended to promote consistency in analyses and allow for comparison between studies.
Our scoring system may be used to analyze data derived from C. elegans experiments that use cell-specific fluorescent reporters that allow for visualization of dopaminergic neurons - specifically the CEP dendrites. Specifically, strains tagged at the dat-1 gene for GFP visualization of the dopaminergic neurons are compatible with this scoring protocol, though many other related transgenic models of PD do exist. It is possible that this scoring system would also be useful with those models; however, this should be validated prior to using them. In particular, it is possible (but not tested to our knowledge) strains with mCherry may not be well suited for this protocol as mCherry aggregation may be indistinguishable from blebs or lead to cell stress. Rather than providing a commentary on all specific models of PD and related neurodegenerative disorders, we focus on the scoring of neurodegeneration data itself. Additionally, this protocol focuses only on neuronal morphology and does not consider fluorescence levels of the soma. Neurodegeneration assays may be performed alongside behavioral assays relevant to neurodegenerative diseases, such as locomotion, lifespan, and health-span experiments. Levels of degeneration in established chemical, age-based, and genetic models of PD can also be confirmed and detailed using this scoring system. Measuring models, contributors, and pathways associated with PD and other neurodegenerative diseases can add to the scientific knowledge about these disorders and point towards how to manage the growing population of affected individuals. Having comparable neurodegeneration results across literature is key in supporting this goal.
To interpret the results derived from this scoring system, we propose considering each dendrite scored as n=1, because different neurons within the same worm often respond differently to treatment. This may be driven by the fact that only the CEPD neurons are directly exposed to the pseudocoelomic body fluid. As such, this allows the score spread of experimental groups to be displayed as proportions of the total number of dendrites scored in each group. This method, used for the representative results shown here, allows for easy comparison across treatment groups, accounts for differential responses within the same worm, and is easily analyzed with a Chi-squared test complimented by a Bonferroni correction for multiple comparisons. An example template for recording neuron scores and calculating percentages can be found in Supplementary File 2. We have considered two alternate methods for data analysis and identify flaws in each. The first option is averaging the scores of the four CEP neurons for each worm. This parametrizes the data; however, it assumes a linear relationship with increasing score and loses information about any variations in response to treatment within the same worm. The second option is to sum the scores of all four CEP neurons for each worm, which also parametrizes the data. This still assumes a linear relationship between scores, however it more capably accounts for differences within each worm than averaged scores by expanding the parameters of possible scores. However individual researchers decide to display their data, the results should be considered alongside experimental variables such as strain and worm age; for example, older worms have a higher expected baseline level of degeneration.
As these neurodegeneration score results are interpreted, researchers should also be aware of a few caveats and limitations of the scoring method. First, certain technological requirements are necessary to capture images suitable for scoring. The imaging microscope must support fluorescence channels and magnification and exposure settings that allow for clear visualization of CEP dendrites. As noted in the protocol, technological requirements may be reduced by protocol adjustments like scoring live images through the microscopic field rather than capturing images to be archived and scored at a later time. Second, possible statistical analysis methods for this data are limited as the data is non-parametric. The scoring scale is presumed to be progressive, but cannot be considered numeric since there are discrete score options and score increases are not necessarily proportional to each other with respect to biological function. For these reasons, chi-squared tests for independence are best suited for this type of data, meaning the statistical analysis depends on the observer to determine the direction of any statistical significance. Notably, the chi-squared test also only analyzes for differences in score distribution and is unable to provide evidence of differences in specific scoring categories. Finally, the functional significance of the morphological changes quantified by this scoring system have yet to be studied.
The future directions prompted by the development of this scoring system involve determining biological bases and correlations with individual neuron scores. Studying the functional significance (e.g. neuronal signaling, worm behavior) of all points on the scoring scale will inform how to better translate results to conclusions applicable to understanding the causes and consequences of neurodegenerative diseases and developing prevention and treatment options. Future research on neurodegeneration in worms should aim to discover connections to other morphology, such as worm shape and size. Additionally, neurodegeneration research can be supported by studying other reporter C. elegans strains to measure endpoints such as bioenergetics, reactive oxygen species production, and mitochondrial morphology.
The authors have no disclosures.
We wish to acknowledge Ian T. Ryde, for contributions to the development of the scoring scale and for his support during the creation of this manuscript. This work was supported by the National Institutes of Health (T32ES021432 supported KSM, and P42ES010356 to JNM).
|dimethyl sulfoxide (DMSO)
|ImageJ 1.5e or newer. Rasband, W.S., ImageJ, U. S. National Institutes of Health, Bethesda, Maryland, USA, https:// imagej.nih.gov/ij/, 1997-2016.
|Microscope Slides 3x1"
|Sodium Azide (NaN_3)
|Tetramisole (Levamisole) Hydrochloride (HCl)
- Maulik, M., Mitra, S., Bult-Ito, A., Taylor, B. E., Vayndorf, E. M. Behavioral Phenotyping and Pathological Indicators of Parkinson's Disease in C. elegans Models. Frontiers in Genetics. 8 (77), (2017).
- Hayes, M. T. Parkinson's Disease and Parkinsonism. Review. The American Journal of Medicine. 132 (7), 802-807 (2019).
- Pouchieu, C., et al. Pesticide use in agriculture and Parkinson's disease in the AGRICAN cohort study. International Journal of Epidemiology. 47 (1), 299-310 (2018).
- Brenner, S. The Genetics of Caenorhabditis elegans. Genetics. 77 (1), 71-94 (1973).
- Nass, R., Hall, D. H., Miller, D. M., Blakely, R. D. Neurotoxin-induced degeneration of dopamine neurons in Caenorhabditis elegans. Proceedings of the National Academy of Sciences of the United States of America. 99 (5), 3264-3269 (2002).
- Wu, S., et al. Mutation of hop-1 and pink-1 attenuates vulnerability of neurotoxicity in C. elegans: the role of mitochondria-associated membrane proteins in Parkinsonism. Experimental Neurology. 309, 67-78 (2018).
- Chikka, M. R., Anbalagan, C., Dvorak, K., Dombeck, K., Prahlad, V. The Mitochondria-Regulated Immune Pathway Activated in the C. elegans Intestine Is Neuroprotective. Cell Reports. 16 (9), 2399-2414 (2016).
- Nass, R., Miller, D. M., Blakely, R. D. C-elegans: a novel pharmacogenetic model to study Parkinson's disease. Parkinsonism Relat D. 7 (3), 185-191 (2001).
- Benedetto, A., Au, C., Aschner, M., Nass, R. Manganese and C. elegans in Parkinson's disease. Parkinson's Disease: Pathogenic and Therapeutic Insights from Toxin and Genetic Models., Life Science. Nass, R., Przedborski, S. , Elsevier Inc. (2008).
- Harrington, A. J., Hamamichi, S., Caldwell, G. A., Caldwell, K. A. C. elegans as a Model Organism to Investigate Molecular Pathways Involved with Parkinson's Disease. Developmental Dynamics. 239 (5), 1282-1295 (2010).
- Cooper, J. F., Van Raamsdonk, J. M. Modeling Parkinson's Disease in C. elegans. Journal of Parkinson's Disease. 8 (1), 17-32 (2018).
- Chege, P. M., McColl, G. Caenorhabditis elegans: a model to investigate oxidative stress and metal dyshomeostasis in Parkinson's disease. Frontiers in AGING NEUROSCIENCE. 6, 89 (2014).
- Lu, C. L., Svoboda, K. R., Lenz, K. A., Pattison, C., Ma, H. B. Toxicity interactions between manganese (Mn) and lead (Pb) or cadmium (Cd) in a model organism the nematode C. elegans. Environmental Science and Pollution Research. 25 (16), 15378-15389 (2018).
- Negga, R., et al. Exposure to Mn/Zn ethylene-bis-dithiocarbamate and glyphosate pesticides leads to neurodegeneration in Caenorhabditis elegans. Neurotoxicology. 32 (3), 331-341 (2011).
- Nagarajan, A., et al. Progressive degeneration of dopaminergic neurons through TRP channel-induced cell death. Journal of Neuroscience. 34 (17), 5738-5746 (2014).
- Salim, C., Rajini, P. S. Glucose-rich diet aggravates monocrotophos-induced dopaminergic neuronal dysfunction in Caenorhabditis elegans. Journal of Applied Toxicology. 37 (6), 772-780 (2017).
- Ved, R., et al. Similar patterns of mitochondrial vulnerability and rescue induced by genetic modification of alpha-synuclein, parkin, and DJ-1 in Caenorhabditis elegans. Journal of Biological Chemistry. 280 (52), 42655-42668 (2005).
- Yao, C., et al. LRRK2-mediated neurodegeneration and dysfunction of dopaminergic neurons in a Caenorhabditis elegans model of Parkinson's disease. Neurobiology of Disease. 40 (1), 73-81 (2010).
- Pivtoraiko, V. N., et al. Low-dose bafilomycin attenuates neuronal cell death associated with autophagy-lysosome pathway dysfunction. Journal of Neurochemistry. 114 (4), 1193-1204 (2010).
- Civelek, M., Mehrkens, J. F., Carstens, N. M., Fitzenberger, E., Wenzel, U. Inhibition of mitophagy decreases survival of Caenorhabditis elegans by increasing protein aggregation. Molecular and Cellular Biochemistry. 452 (1-2), 123-131 (2019).
- Van Pelt, K. M., Truttmann, M. C. Caenorhabditis elegans as a model system for studying aging-associated neurodegenerative diseases. Translational Medicine of Aging. 4, 60-72 (2020).
- Youssef, K., Tandon, A., Rezai, P. Studying Parkinson's disease using Caenorhabditis elegans models in microfluidic devices. Integrative Biology. 11 (5), 186-207 (2019).
- Lesage, S., Brice, A. Parkinson's disease: from monogenic forms to genetic susceptibility factors. Human Molecular Genetics. 18, 48-59 (2009).
- Gasser, T. Usefulness of Genetic Testing in PD and PD Trials: A Balanced Review. Journal of Parkinson's Disease. 5 (2), 209-215 (2015).
- Bronstein, J., et al. Meeting report: consensus statement-Parkinson's disease and the environment: collaborative on health and the environment and Parkinson's Action Network (CHE PAN) conference 26-28 June 2007. Environmental Health Perspectives. 117 (1), 117-121 (2009).
- Migliore, L., Coppede, F. Genetics, environmental factors and the emerging role of epigenetics in neurodegenerative diseases. Mutation Research. 667 (1-2), 82-97 (2009).
- Schapira, A. H. Mitochondria in the aetiology and pathogenesis of Parkinson's disease. Lancet Neurology. 7 (1), 97-109 (2008).
- Lill, C. M. Genetics of Parkinson's disease. Molecular and Cellular Probes. 30 (6), 386-396 (2016).
- Smith, L. Strengths and limitations of morphological and behavioral analyses in detecting dopaminergic deficiency in Caenorhabditis elegans. Neurotoxicology. 74, 209-220 (2019).
- Hindle, J. V. Ageing, neurodegeneration and Parkinson's disease. Age and Ageing. 39, 156-161 (2010).
- Luo, Z., et al. Age-dependent nigral dopaminergic neurodegeneration and α-synuclein accumulation in RGS6-deficient mice. JCI Insight. 4 (13), 126769 (2018).
- Berkowitz, L. A., et al. Video Article: Application of a C. elegans Dopamine Neuron Degeneration Assay for the Validation of Potential Parkinson's Disease Genes. Journal of Visualized Experiments. (17), e835 (2008).
- Tucci, M. L., Harrington, A. J., Caldwell, G. A., Caldwell, K. A. Modeling Dopamine Neuron Degeneration in Caenorhabditis elegans. Methods in Molecular Biology. 793 (19), 129-148 (2011).
- Hartman, J. H., et al. Genetic Defects in Mitochondrial Dynamics in Caenorhabditis elegans Impact Ultraviolet C Radiation- and 6-hydroxydopamine-Induced Neurodegeneration. International Journal of Molecular Sciences. 20 (3202), (2019).
- Caldwell, K. A., Wilicott, C. W., Caldwell, G. A. Modeling neurodegeneration in Caenorhabditis elegans. Disease Models & Mechanisms. 13, (2020).
- Cothren, S. D., Meyer, J. N., Hartman, J. H. Blinded Visual Scoring of Images Using the Freely-available Software Blinder. Biological Protocols. 8 (23), (2018).
- National Center for Biotechnology Information. PubChem Compound Summary for CID 6758, Rotenone. PubChem. , (2021).
- Heinz, S., et al. Mechanistic Investigations of the Mitochondrial Complex I Inhibitor Rotenone in the Context of Pharmacological and Safety Evaluation. Scientific Reports. 7 (45465), (2017).
- Lewis, J. A., Fleming, J. T. Basic culture methods. Methods in Cell Biology. 48 (1), 3-29 (1995).
- Boyd, W. A., et al. Application of a Mathematical Model to Describe the Effects of Chlorpyrifos on Caenorhabditis elegans Development. PLoS ONE. 4 (9), 7024 (2009).
| english |
export default (arr, { minX, minY, maxX, maxY }, max, min, maxAmount) => {
arr = arr.map(item => (typeof item === "number" ? item : item.value));
const minValue = min - 0.001;
const gridX = (maxX - minX) / (maxAmount - 1);
const gridY = (maxY - minY) / (max + 0.001 - minValue);
return arr.map((value, index) => {
return {
x: index * gridX + minX,
y:
maxY -
(value - minValue) * gridY +
+(index === maxAmount - 1) * 0.00001 -
+(index === 0) * 0.00001
};
});
};
| javascript |
Vimeo, the thinking man's YouTube, has just undergone its biggest ever redesign and its first since 2007. It's been a year's worth of work and a mammoth undertaking that's seen the site rebuilt from the ground up, and today it enters a closed beta.
That means that some of you will be lucky enough to try the swish new site out, but most of us will be languishing on the old version for a couple more months.
But never fear - Vimeo let TechRadar peek behind the curtain so we can show you all the design delights you've got to look forward to.
The inbox is much cleaner and makes it much clearer to see what videos are listed and why – Vimeo has taken a blog-like approach and it works really well.
By far our favourite new feature is the video ticker that is sneakily hidden away at the top of each page. The cute kaleidoscopic header slides out when you click 'more videos' and offers you a bunch of video recommendations, a playlist of videos you've liked, as well as quick access to your feed and your 'watch later' list.
It's smooth, clean and convenient. When you're sick of it, just hit 'hide videos' and it'll be as though it was never there.
Vimeo is all about the videos, though. So when you go to a clip page to watch a video (like the utterly excellent Star Wars Uncut), all the extra clutter has been swept away. You get the video, the synopsis and not much else at first glance.
Options and navigation are hidden in drop-down menus across the header and under the player. Very clean and very tidy. Stoppit and Tidyup would be proud.
Other handy new features include improved search, which will allow you to use voice recognition in Chrome as well as advanced search functions that allow you to filter by license types, video length etc - it's going to be really handy for videographers.
Finding new videos has always been a bit of a pain, so while the search improvements are welcome, we'd like to see a more sentient recommendations service. At present, Vimeo uses similar tags and relevant channels to make suggestions; something more algorithmic like Last.fm's recommendation service would be amazing.
New Vimeo will also allow you to upload multiple files in the redesign, which means you can set it to work uploading your trilogy of Tarantino homages, go out and shoot the fourth part, and come back to find them all online.
A redesigned website might not seem like groundbreaking news, but Vimeo's 65 million users are going to love it. (Interesting fact: London is its largest city in terms of users.)
The comparisons with YouTube are inevitable, but the two sites have grown into very different beasts. Where YouTube scrambles to make money from adverts, premium content by jamming as much content on to a page as possible, Vimeo aims to let the video shine. And the redesign, which manages to retain all of the site's quirky coolness, does just that.
The closed beta will run until all the bugs are caught and quashed, with a projected launch date of the end of Q1/early Q2 (March/April).
Get the hottest deals available in your inbox plus news, reviews, opinion, analysis, deals and more from the TechRadar team.
Former UK News Editor for TechRadar, it was a perpetual challenge among the TechRadar staff to send Kate (Twitter, Google+) a link to something interesting on the internet that she hasn't already seen. As TechRadar's News Editor (UK), she was constantly on the hunt for top news and intriguing stories to feed your gadget lust. Kate now enjoys life as a renowned music critic – her words can be found in the i Paper, Guardian, GQ, Metro, Evening Standard and Time Out, and she's also the author of 'Amy Winehouse', a biography of the soul star.
| english |
/*
* Copyright 2018 INS Ecosystem
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package network
import (
"bytes"
"errors"
"math"
"strconv"
"testing"
"time"
"github.com/insolar/network/connection"
"github.com/insolar/network/message"
"github.com/insolar/network/node"
"github.com/insolar/network/routing"
"github.com/insolar/network/rpc"
"github.com/insolar/network/store"
"github.com/insolar/network/transport"
"github.com/stretchr/testify/assert"
)
func getDefaultCtx(dht *DHT) Context {
ctx, _ := NewContextBuilder(dht).SetDefaultNode().Build()
return ctx
}
type mockFuture struct {
result chan *message.Message
actor *node.Node
request *message.Message
requestID message.RequestID
}
func (f *mockFuture) ID() message.RequestID {
return f.requestID
}
func (f *mockFuture) Actor() *node.Node {
return f.actor
}
func (f *mockFuture) Request() *message.Message {
return f.request
}
func (f *mockFuture) Result() <-chan *message.Message {
return f.result
}
func (f *mockFuture) SetResult(msg *message.Message) {
f.result <- msg
}
func (f *mockFuture) Cancel() {}
type mockTransport struct {
recv chan *message.Message
send chan *message.Message
dc chan bool
msgChan chan *message.Message
failNext bool
sequence *uint64
}
func newMockTransport() *mockTransport {
net := &mockTransport{
recv: make(chan *message.Message),
send: make(chan *message.Message),
dc: make(chan bool),
msgChan: make(chan *message.Message),
failNext: false,
sequence: new(uint64),
}
return net
}
func (t *mockTransport) Start() error {
return nil
}
func (t *mockTransport) Stop() {
close(t.dc)
}
func (t *mockTransport) Close() {
close(t.recv)
close(t.send)
close(t.msgChan)
}
func (t *mockTransport) Stopped() chan bool {
return t.dc
}
func (t *mockTransport) Messages() chan *message.Message {
return t.msgChan
}
func (t *mockTransport) failNextSendMessage() {
t.failNext = true
}
func (t *mockTransport) SendRequest(q *message.Message) (transport.Future, error) {
id := transport.AtomicLoadAndIncrementUint64(t.sequence)
if t.failNext {
t.failNext = false
return nil, errors.New("MockNetworking Error")
}
t.recv <- q
return &mockFuture{result: t.send, request: q, actor: q.Receiver, requestID: message.RequestID(id)}, nil
}
func (t *mockTransport) SendResponse(requestID message.RequestID, q *message.Message) error {
if t.failNext {
t.failNext = false
return errors.New("MockNetworking Error")
}
return nil
}
func mockFindNodeResponse(request *message.Message, nextID []byte) *message.Message {
r := &message.Message{}
n := &node.Node{}
n.ID = request.Sender.ID
n.Address = request.Sender.Address
r.Receiver = n
netAddr, _ := node.NewAddress("0.0.0.0:3001")
r.Sender = &node.Node{ID: request.Receiver.ID, Address: netAddr}
r.Type = request.Type
r.IsResponse = true
responseData := &message.ResponseDataFindNode{}
responseData.Closest = []*node.Node{{ID: nextID, Address: netAddr}}
r.Data = responseData
return r
}
func mockFindNodeResponseEmpty(request *message.Message) *message.Message {
r := &message.Message{}
n := &node.Node{}
n.ID = request.Sender.ID
n.Address = request.Sender.Address
r.Receiver = n
netAddr, _ := node.NewAddress("0.0.0.0:3001")
r.Sender = &node.Node{ID: request.Receiver.ID, Address: netAddr}
r.Type = request.Type
r.IsResponse = true
responseData := &message.ResponseDataFindNode{}
responseData.Closest = []*node.Node{}
r.Data = responseData
return r
}
func dhtParams(ids []node.ID, address string) (store.Store, *node.Origin, transport.Transport, rpc.RPC, error) {
st := store.NewMemoryStore()
addr, _ := node.NewAddress(address)
origin, err := node.NewOrigin(ids, addr)
tp := newMockTransport()
r := rpc.NewRPC()
return st, origin, tp, r, err
}
func realDhtParams(ids []node.ID, address string) (store.Store, *node.Origin, transport.Transport, rpc.RPC, error) {
st := store.NewMemoryStore()
addr, _ := node.NewAddress(address)
origin, _ := node.NewOrigin(ids, addr)
conn, _ := connection.NewConnectionFactory().Create(address)
tp, err := transport.NewUTPTransport(conn)
r := rpc.NewRPC()
return st, origin, tp, r, err
}
// Creates twenty DHTs and bootstraps each with the previous
// at the end all should know about each other
func TestBootstrapTwentyNodes(t *testing.T) {
done := make(chan bool)
port := 3000
var dhts []*DHT
for i := 0; i < 20; i++ {
id, _ := node.NewIDs(1)
st, s, tp, r, _ := realDhtParams(id, "127.0.0.1:"+strconv.Itoa(port))
address, _ := node.NewAddress("127.0.0.1:" + strconv.Itoa(port-1))
bootstrapNode := node.NewNode(address)
dht, err := NewDHT(st, s, tp, r, &Options{
BootstrapNodes: []*node.Node{
bootstrapNode,
},
})
port++
dhts = append(dhts, dht)
assert.NoError(t, err)
}
for _, dht := range dhts {
ctx, _ := NewContextBuilder(dht).SetDefaultNode().Build()
assert.Equal(t, 0, dht.NumNodes(ctx))
go func(dht *DHT) {
err := dht.Listen()
assert.Equal(t, "closed", err.Error())
done <- true
}(dht)
go func(dht *DHT) {
err := dht.Bootstrap()
assert.NoError(t, err)
}(dht)
time.Sleep(time.Millisecond * 200)
}
time.Sleep(time.Millisecond * 2000)
for _, dht := range dhts {
ctx, _ := NewContextBuilder(dht).SetDefaultNode().Build()
assert.Equal(t, 19, dht.NumNodes(ctx))
dht.Disconnect()
<-done
}
}
// Creates two DHTs, bootstrap one using the other, ensure that they both know
// about each other afterwards.
func TestBootstrapTwoNodes(t *testing.T) {
done := make(chan bool)
id1, _ := node.NewIDs(1)
st, s, tp, r, err := realDhtParams(id1, "127.0.0.1:3000")
dht1, _ := NewDHT(st, s, tp, r, &Options{})
assert.NoError(t, err)
bootstrapAddr2, _ := node.NewAddress("127.0.0.1:3000")
st2, s2, tp2, r2, err := realDhtParams(nil, "127.0.0.1:3001")
dht2, _ := NewDHT(st2, s2, tp2, r2, &Options{
BootstrapNodes: []*node.Node{
{
ID: id1[0],
Address: bootstrapAddr2,
},
},
})
assert.NoError(t, err)
assert.Equal(t, 0, dht1.NumNodes(getDefaultCtx(dht1)))
assert.Equal(t, 0, dht2.NumNodes(getDefaultCtx(dht2)))
go func() {
go func() {
err2 := dht2.Bootstrap()
assert.NoError(t, err2)
time.Sleep(50 * time.Millisecond)
dht2.Disconnect()
dht1.Disconnect()
done <- true
}()
err3 := dht2.Listen()
assert.Equal(t, "closed", err3.Error())
done <- true
}()
err = dht1.Listen()
assert.Equal(t, "closed", err.Error())
assert.Equal(t, 1, dht1.NumNodes(getDefaultCtx(dht1)))
assert.Equal(t, 1, dht2.NumNodes(getDefaultCtx(dht2)))
<-done
<-done
}
// Creates three DHTs, bootstrap B using A, bootstrap C using B. A should know
// about both B and C
func TestBootstrapThreeNodes(t *testing.T) {
done := make(chan bool)
id1, _ := node.NewIDs(1)
st1, s1, tp1, r1, err := realDhtParams(id1, "127.0.0.1:3000")
assert.NoError(t, err)
dht1, _ := NewDHT(st1, s1, tp1, r1, &Options{})
id2, _ := node.NewIDs(1)
st2, s2, tp2, r2, err := realDhtParams(id2, "127.0.0.1:3001")
assert.NoError(t, err)
dht2, _ := NewDHT(st2, s2, tp2, r2, &Options{
BootstrapNodes: []*node.Node{
{
ID: id1[0],
Address: dht1.origin.Address,
},
},
})
st3, s3, tp3, r3, err := realDhtParams(nil, "127.0.0.1:3002")
assert.NoError(t, err)
dht3, _ := NewDHT(st3, s3, tp3, r3, &Options{
BootstrapNodes: []*node.Node{
{
ID: id2[0],
Address: dht2.origin.Address,
},
},
})
assert.Equal(t, 0, dht1.NumNodes(getDefaultCtx(dht1)))
assert.Equal(t, 0, dht2.NumNodes(getDefaultCtx(dht2)))
assert.Equal(t, 0, dht3.NumNodes(getDefaultCtx(dht3)))
go func(dht1 *DHT, dht2 *DHT, dht3 *DHT) {
go func(dht1 *DHT, dht2 *DHT, dht3 *DHT) {
err2 := dht2.Bootstrap()
assert.NoError(t, err2)
go func(dht1 *DHT, dht2 *DHT, dht3 *DHT) {
err3 := dht3.Bootstrap()
assert.NoError(t, err3)
time.Sleep(500 * time.Millisecond)
dht1.Disconnect()
time.Sleep(100 * time.Millisecond)
dht2.Disconnect()
dht3.Disconnect()
done <- true
}(dht1, dht2, dht3)
err4 := dht3.Listen()
assert.Equal(t, "closed", err4.Error())
done <- true
}(dht1, dht2, dht3)
err5 := dht2.Listen()
assert.Equal(t, "closed", err5.Error())
done <- true
}(dht1, dht2, dht3)
err = dht1.Listen()
assert.Equal(t, "closed", err.Error())
assert.Equal(t, 2, dht1.NumNodes(getDefaultCtx(dht1)))
assert.Equal(t, 2, dht2.NumNodes(getDefaultCtx(dht2)))
assert.Equal(t, 2, dht3.NumNodes(getDefaultCtx(dht3)))
<-done
<-done
<-done
}
// Creates two DHTs and bootstraps using only IP:Port. Connecting node should
// ping the first node to find its RequestID
func TestBootstrapNoID(t *testing.T) {
done := make(chan bool)
id1, _ := node.NewIDs(1)
st1, s1, tp1, r1, err := realDhtParams(id1, "0.0.0.0:3000")
assert.NoError(t, err)
dht1, _ := NewDHT(st1, s1, tp1, r1, &Options{})
st2, s2, tp2, r2, err := realDhtParams(nil, "0.0.0.0:3001")
assert.NoError(t, err)
dht2, _ := NewDHT(st2, s2, tp2, r2, &Options{
BootstrapNodes: []*node.Node{
{
Address: dht1.origin.Address,
},
},
})
assert.Equal(t, 0, dht1.NumNodes(getDefaultCtx(dht1)))
assert.Equal(t, 0, dht2.NumNodes(getDefaultCtx(dht2)))
go func() {
go func() {
err2 := dht2.Bootstrap()
assert.NoError(t, err2)
time.Sleep(50 * time.Millisecond)
dht2.Disconnect()
dht1.Disconnect()
done <- true
}()
err3 := dht2.Listen()
assert.Equal(t, "closed", err3.Error())
done <- true
}()
err = dht1.Listen()
assert.Equal(t, "closed", err.Error())
assert.Equal(t, 1, dht1.NumNodes(getDefaultCtx(dht1)))
assert.Equal(t, 1, dht2.NumNodes(getDefaultCtx(dht2)))
<-done
<-done
}
// Create two DHTs have them connect and bootstrap, then disconnect. Repeat
// 100 times to ensure that we can use the same IP and port without EADDRINUSE
// errors.
func TestReconnect(t *testing.T) {
for i := 0; i < 100; i++ {
done := make(chan bool)
id1, _ := node.NewIDs(1)
st1, s1, tp1, r1, err := realDhtParams(id1, "127.0.0.1:3000")
assert.NoError(t, err)
dht1, _ := NewDHT(st1, s1, tp1, r1, &Options{})
st2, s2, tp2, r2, err := realDhtParams(nil, "127.0.0.1:3001")
assert.NoError(t, err)
dht2, _ := NewDHT(st2, s2, tp2, r2, &Options{
BootstrapNodes: []*node.Node{
{
ID: id1[0],
Address: dht1.origin.Address,
},
},
})
assert.Equal(t, 0, dht1.NumNodes(getDefaultCtx(dht1)))
go func() {
go func() {
err2 := dht2.Bootstrap()
assert.NoError(t, err2)
dht2.Disconnect()
dht1.Disconnect()
done <- true
}()
err3 := dht2.Listen()
assert.Equal(t, "closed", err3.Error())
done <- true
}()
err = dht1.Listen()
assert.Equal(t, "closed", err.Error())
assert.Equal(t, 1, dht1.NumNodes(getDefaultCtx(dht1)))
assert.Equal(t, 1, dht2.NumNodes(getDefaultCtx(dht2)))
<-done
<-done
}
}
// Create two DHTs and have them connect. Send a store message with 100mb
// payload from one node to another. Ensure that the other node now has
// this data in its store.
func TestStoreAndFindLargeValue(t *testing.T) {
done := make(chan bool)
id1, _ := node.NewIDs(1)
st1, s1, tp1, r1, _ := realDhtParams(id1, "127.0.0.1:3000")
dht1, _ := NewDHT(st1, s1, tp1, r1, &Options{})
st2, s2, tp2, r2, _ := realDhtParams(nil, "127.0.0.1:3001")
dht2, _ := NewDHT(st2, s2, tp2, r2, &Options{
BootstrapNodes: []*node.Node{
{
ID: id1[0],
Address: dht1.origin.Address,
},
},
})
go func() {
err := dht1.Listen()
assert.Equal(t, "closed", err.Error())
done <- true
}()
go func() {
err := dht2.Listen()
assert.Equal(t, "closed", err.Error())
done <- true
}()
time.Sleep(1 * time.Second)
dht2.Bootstrap()
payload := [1000000]byte{}
key, err := dht1.Store(getDefaultCtx(dht1), payload[:])
assert.NoError(t, err)
time.Sleep(1 * time.Second)
value, exists, err := dht2.Get(getDefaultCtx(dht1), key)
assert.NoError(t, err)
assert.Equal(t, true, exists)
assert.Equal(t, 0, bytes.Compare(payload[:], value))
dht1.Disconnect()
dht2.Disconnect()
<-done
<-done
}
// Tests sending a message which results in an error when attempting to
// send over uTP
func TestNetworkingSendError(t *testing.T) {
id := getIDWithValues(0)
done := make(chan int)
bootstrapAddr, _ := node.NewAddress("0.0.0.0:3001")
st, s, tp, r, err := dhtParams([]node.ID{id}, "0.0.0.0:3000")
assert.NoError(t, err)
dht, _ := NewDHT(st, s, tp, r, &Options{
BootstrapNodes: []*node.Node{{
ID: getZerodIDWithNthByte(1, byte(255)),
Address: bootstrapAddr,
}},
})
mockTp := tp.(*mockTransport)
go func() {
dht.Listen()
}()
go func() {
v := <-mockTp.recv
assert.Nil(t, v)
close(done)
}()
mockTp.failNextSendMessage()
dht.Bootstrap()
dht.Disconnect()
<-done
}
// Tests sending a message which results in a successful send, but the node
// never responds
func TestNodeResponseSendError(t *testing.T) {
id := getIDWithValues(0)
done := make(chan int)
bootstrapAddr, _ := node.NewAddress("0.0.0.0:3001")
st, s, tp, r, err := dhtParams([]node.ID{id}, "0.0.0.0:3000")
assert.NoError(t, err)
dht, _ := NewDHT(st, s, tp, r, &Options{
BootstrapNodes: []*node.Node{{
ID: getZerodIDWithNthByte(1, byte(255)),
Address: bootstrapAddr,
}},
})
mockTp := tp.(*mockTransport)
queries := 0
go func() {
dht.Listen()
}()
go func() {
for {
request := <-mockTp.recv
if request == nil {
return
}
if queries == 1 {
// Don't respond
close(done)
} else {
queries++
res := mockFindNodeResponse(request, getZerodIDWithNthByte(2, byte(255)))
mockTp.send <- res
}
}
}()
dht.Bootstrap()
assert.Equal(t, 1, dht.tables[0].TotalNodes())
dht.Disconnect()
<-done
}
// Tests a bucket refresh by setting a very low RefreshTime value, adding a single
// node to a bucket, and waiting for the refresh message for the bucket
func TestBucketRefresh(t *testing.T) {
id := getIDWithValues(0)
done := make(chan int)
refresh := make(chan int)
bootstrapAddr, _ := node.NewAddress("0.0.0.0:3001")
st, s, tp, r, err := dhtParams([]node.ID{id}, "0.0.0.0:3000")
assert.NoError(t, err)
dht, _ := NewDHT(st, s, tp, r, &Options{
RefreshTime: time.Second * 2,
BootstrapNodes: []*node.Node{{
ID: getZerodIDWithNthByte(1, byte(255)),
Address: bootstrapAddr,
}},
})
mockTp := tp.(*mockTransport)
queries := 0
go func() {
dht.Listen()
}()
go func() {
for {
request := <-mockTp.recv
if request == nil {
close(done)
return
}
queries++
res := mockFindNodeResponseEmpty(request)
mockTp.send <- res
if queries == 2 {
close(refresh)
}
}
}()
dht.Bootstrap()
assert.Equal(t, 1, dht.tables[0].TotalNodes())
<-refresh
dht.Disconnect()
<-done
}
// Tets store replication by setting the ReplicateTime time to a very small value.
// Stores some data, and then expects another store message in ReplicateTime time
func TestStoreReplication(t *testing.T) {
id := getIDWithValues(0)
done := make(chan int)
replicate := make(chan int)
bootstrapAddr, _ := node.NewAddress("0.0.0.0:3001")
st, s, tp, r, err := dhtParams([]node.ID{id}, "0.0.0.0:3000")
assert.NoError(t, err)
dht, _ := NewDHT(st, s, tp, r, &Options{
ReplicateTime: time.Second * 2,
BootstrapNodes: []*node.Node{{
ID: getZerodIDWithNthByte(1, byte(255)),
Address: bootstrapAddr,
}},
})
mockTp := tp.(*mockTransport)
go func() {
dht.Listen()
}()
stores := 0
go func() {
for {
request := <-mockTp.recv
if request == nil {
close(done)
return
}
switch request.Type {
case message.TypeFindNode:
res := mockFindNodeResponseEmpty(request)
mockTp.send <- res
case message.TypeStore:
stores++
d := request.Data.(*message.RequestDataStore)
assert.Equal(t, []byte("foo"), d.Data)
if stores >= 2 {
close(replicate)
}
}
}
}()
dht.Bootstrap()
dht.Store(getDefaultCtx(dht), []byte("foo"))
<-replicate
dht.Disconnect()
<-done
}
// Test Expiration by setting ExpirationTime to a very low value. Store a value,
// and then wait longer than ExpirationTime. The value should no longer exist in
// the store.
func TestStoreExpiration(t *testing.T) {
id := getIDWithValues(0)
st, s, tp, r, err := realDhtParams([]node.ID{id}, "0.0.0.0:3000")
assert.NoError(t, err)
dht, _ := NewDHT(st, s, tp, r, &Options{
ExpirationTime: time.Second,
})
go func() {
dht.Listen()
}()
k, _ := dht.Store(getDefaultCtx(dht), []byte("foo"))
v, exists, _ := dht.Get(getDefaultCtx(dht), k)
assert.Equal(t, true, exists)
assert.Equal(t, []byte("foo"), v)
<-time.After(time.Second * 3)
_, exists, _ = dht.Get(getDefaultCtx(dht), k)
assert.Equal(t, false, exists)
dht.Disconnect()
}
// Create a new node and bootstrap it. All nodes in the network know of a
// single node closer to the original node. This continues until every MaxContactsInBucket bucket
// is occupied.
func TestFindNodeAllBuckets(t *testing.T) {
id := getIDWithValues(0)
bootstrapAddr, _ := node.NewAddress("0.0.0.0:3001")
st, s, tp, r, err := dhtParams([]node.ID{id}, "0.0.0.0:3000")
assert.NoError(t, err)
dht, _ := NewDHT(st, s, tp, r, &Options{
BootstrapNodes: []*node.Node{{
ID: getZerodIDWithNthByte(0, byte(math.Pow(2, 7))),
Address: bootstrapAddr,
}},
})
mockTp := tp.(*mockTransport)
go func() {
dht.Listen()
}()
var k = 0
var i = 6
go func() {
for {
request := <-mockTp.recv
if request == nil {
return
}
res := mockFindNodeResponse(request, getZerodIDWithNthByte(k, byte(math.Pow(2, float64(i)))))
i--
if i < 0 {
i = 7
k++
}
if k > 19 {
k = 19
}
mockTp.send <- res
}
}()
dht.Bootstrap()
for _, v := range dht.tables[0].RoutingTable {
assert.Equal(t, 1, len(v))
}
dht.Disconnect()
}
// Tests timing out of nodes in a bucket. DHT bootstraps networks and learns
// about 20 subsequent nodes in the same bucket. Upon attempting to add the 21st
// node to the now full bucket, we should receive a ping to the very first node
// added in order to determine if it is still alive.
func TestAddNodeTimeout(t *testing.T) {
id := getIDWithValues(0)
done := make(chan int)
pinged := make(chan int)
bootstrapAddr, _ := node.NewAddress("0.0.0.0:3001")
st, s, tp, r, err := dhtParams([]node.ID{id}, "0.0.0.0:3000")
assert.NoError(t, err)
dht, _ := NewDHT(st, s, tp, r, &Options{
BootstrapNodes: []*node.Node{{
ID: getZerodIDWithNthByte(1, byte(255)),
Address: bootstrapAddr,
}},
})
mockTp := tp.(*mockTransport)
go func() {
dht.Listen()
}()
var nodesAdded = 1
var firstNode []byte
var lastNode []byte
go func() {
for {
request := <-mockTp.recv
if request == nil {
return
}
switch request.Type {
case message.TypeFindNode:
id := getIDWithValues(0)
if nodesAdded > routing.MaxContactsInBucket+1 {
close(done)
return
}
if nodesAdded == 1 {
firstNode = id
}
if nodesAdded == routing.MaxContactsInBucket {
lastNode = id
}
id[1] = byte(255 - nodesAdded)
nodesAdded++
res := mockFindNodeResponse(request, id)
mockTp.send <- res
case message.TypePing:
assert.Equal(t, message.TypePing, request.Type)
assert.Equal(t, getZerodIDWithNthByte(1, byte(255)), request.Receiver.ID)
close(pinged)
}
}
}()
dht.Bootstrap()
// ensure the first node in the table is the second node contacted, and the
// last is the last node contacted
assert.Equal(t, 0, bytes.Compare(dht.tables[0].RoutingTable[routing.KeyBitSize-9][0].ID, firstNode))
assert.Equal(t, 0, bytes.Compare(dht.tables[0].RoutingTable[routing.KeyBitSize-9][19].ID, lastNode))
<-done
<-pinged
dht.Disconnect()
}
func TestGetRandomIDFromBucket(t *testing.T) {
id := getIDWithValues(0)
st, s, tp, r, err := realDhtParams([]node.ID{id}, "0.0.0.0:3000")
assert.NoError(t, err)
dht, _ := NewDHT(st, s, tp, r, &Options{})
go func() {
dht.Listen()
}()
// Bytes should be equal up to the bucket index that the random RequestID was
// generated for, and random afterwards
for i := 0; i < routing.KeyBitSize/8; i++ {
r := dht.tables[0].GetRandomIDFromBucket(i * 8)
for j := 0; j < i; j++ {
assert.Equal(t, byte(0), r[j])
}
}
dht.Disconnect()
}
func getZerodIDWithNthByte(n int, v byte) node.ID {
id := getIDWithValues(0)
id[n] = v
return id
}
func getIDWithValues(b byte) node.ID {
return []byte{b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b, b}
}
| go |
// Consumer of greet
var greet = require('./greet');
greet();
// Object literal
var person = {
first_name: 'John',
last_name: 'Doe',
greet: function () {
console.log('Hello ' + this.first_name + ' ' + this.last_name)
}
}
person.greet(); // Equivalent - person['greet']();
console.log(person['first_name'])
// Function constructor
function Person(first, last) {
this.first_name = first;
this.last_name = last;
this.formal = function() {
console.log('Good morning Ms ' + this.last_name);
}
};
var jane = new Person('Jane', 'Doe');
console.log(jane.first_name + ' ' + jane.last_name);
console.log(jane.__proto__);
// Use its prototype
Person.prototype.friendly = function() {
console.log('Howdy ' + this.first_name);
};
jane.friendly();
jane.formal();
console.log(jane.__proto__);
// Pass by value
function change(b) {
b = 2;
}
var a = 1;
change(a);
console.log(a);
// Pass by reference
function changeObj(d) {
d.prop1 = function() {};
d.prop2 = {};
}
var c = {};
c.prop1 = {};
changeObj(c);
console.log(c);
// Immediately Invoked Function Expressions (IIFE)
var first = 'Jane';
(function (last) {
console.log('IIFE');
var first = 'John'; // Different first
console.log(first);
console.log(last);
}('Doe'));
console.log(first);
| javascript |
<reponame>tetianakravchenko/beats
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. 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.
//go:build ignore
// +build ignore
package add_process_metadata
import (
"strings"
"time"
"github.com/elastic/gosigar"
)
type gosigarProvider struct{}
func (p gosigarProvider) GetProcessMetadata(pid int) (result *processMetadata, err error) {
var procExe gosigar.ProcExe
var procArgs gosigar.ProcArgs
var procEnv gosigar.ProcEnv
var procState gosigar.ProcState
var procTime gosigar.ProcTime
for _, act := range []struct {
getter func(int) error
required bool
}{
{procExe.Get, true},
{procArgs.Get, false},
{procEnv.Get, false},
{procState.Get, false},
{procTime.Get, false},
} {
if err := act.getter(pid); err != nil {
if act.required {
return nil, err
}
}
}
r := processMetadata{
name: procExe.Name,
title: strings.Join(procArgs.List, " "),
exe: procExe.Name,
args: procArgs.List,
env: procEnv.Vars,
pid: pid,
ppid: procState.Ppid,
username: procState.Username,
startTime: time.Unix(int64(procTime.StartTime/1000), int64(procTime.StartTime%1000)*1000000),
}
r.fields = r.toMap()
return &r, nil
}
| go |
<gh_stars>1-10
import { Request, Response, NextFunction } from 'express';
export declare function getAllUsers(req: Request, res: Response, next: NextFunction): Promise<Response | void>;
export declare function getUserByUsername(req: Request, res: Response, next: NextFunction): Promise<Response | void>;
export declare function getUserById(req: Request, res: Response, next: NextFunction): Promise<Response | void>;
export declare function getFullUser(req: any, res: Response, next: NextFunction): Promise<Response | void>;
| typescript |
The Darbhanga airport in north Bihar began operations on Sunday, meeting the long-standing demand of the people of the Mithila region who had to travel for hours to Patna to catch a flight.
As the first flight, operated by Spicejet, landed at the airport from Bengaluru, it was given the customary water salute, while the passengers were greeted with ''Mithila Paags'' (a traditional cap) and garlands.
The plane then took off for Delhi with 180 passengers, including Darbhanga's BJP MP Gopaljee Thakur, Darbhanga Town legislator Sanjay Saraogi and MLC Dilip Chaudhary.
Darbhanga will be connected by flights to Delhi, Mumbai and Bengaluru, officials said. People of the region will save at least four to five hours travelling to and from Patna with the airport beginning operations, the officials added.
"It is really a good beginning. Hope that infrastructure and other facilities at the airport will improve and flight service to other cities will also start," said a passenger who arrived from Bengaluru.
A person, who had come to see off a relative at the airport, said that with the airport starting operations, people will not have to miss flights due to traffic jams while travelling to Patna. "There were times when we used to get stuck at the Gandhi Setu due to traffic jams. Also, now we won't have to travel to Patna to receive someone or to see them off," he said.
Another man who was at the airport to receive his daughter said, "Today, I will be receiving her in my hometown. "
The Airports Authority of India has developed the airport as a civil enclave, which is part of an Indian Air Force base allocated for civil aviation operations, at Kevti, around six km from the Darbhanga town.
The foundation stone for the Darbhanga airport, the third in the state after Patna and Gaya, was laid in December 2018.
The flights will be operated by Spicejet under the regional connectivity scheme 'Udan'. Civil Aviation Minister Hardeep Singh Puri had announced in September that the airport will begin operations in the first week of November ahead of Chhath.
The terminal building of the airport has a capacity to handle 150 passengers, he had said.
Thakur, the local MP, said, "People of the Mithila region are thankful to Prime Minister Narendra Modi for starting flight service from Darbhanga. I also thank the civil aviation minister who began the operations before Chhath Puja. "
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed. ) | english |
United States President Donald Trump has announced a memorandum on spectrum usage, citing the advent and importance of 5G networks as well as the economic, national security, safety, and science goals of the nation.
The memorandum, titled Developing a Sustainable Spectrum Strategy for America's Future, also points to increasing uses of spectrum including autonomous vehicles, the Internet of Things (IoT), commercial space operations, and "precision agriculture".
"It is imperative that America be first in fifth-generation (5G) wireless technologies," the memorandum said.
"Flexible, predictable spectrum access by the United States government will help ensure that federal users can meet current and future mission requirements for a broad range of both communications- and non-communications-based systems."
US Deputy CTO Michael Kratsios said the strategy is aimed at achieving three goals: Ensuring American leadership in 5G; fuelling job growth and economic growth, as well as "quality of life"; and protecting the nation.
"Deploying 5G is only possible if we continue to make additional spectrum available and use it more efficiently," Kratsios said.
"President Trump's memorandum orders federal agencies to review their existing spectrum usage, forecast future demands, and prepare a plan for research and development that will enable better use of spectrum in the future."
While the memorandum said US agencies must continue having access to spectrum, he said they must "thoughtfully consider whether and how their spectrum-dependent mission needs might be met more efficiently and effectively, including through new technology and ingenuity".
"America's national security depends on technological excellence, and the United States government must continue to have access to the spectrum resources needed to serve the national interest, from protecting the homeland and managing the national airspace, to forecasting severe weather and exploring the frontiers of space," the memorandum said.
"The United States government shall also continue to encourage investment and adoption by federal agencies of commercial, dual-use, or other advanced technologies that meet mission requirements, including 5G technologies. In doing so, we will take appropriate measures to sustain the radio-frequency environment in which critical United States infrastructure and space systems operate."
Under Section 4 of the memorandum, the Secretary of Commerce is required within 270 days to submit a long-term National Spectrum Strategy to increase spectrum access, including through spectrum sharing and "improved cooperation and collaboration".
"We're on the verge of new technological revolutions that could improve virtually every aspect of our lives, create vast new wealth for American workers and families, and open up bold, new frontiers in science, medicine, and communication," Trump said on Thursday.
The National Spectrum Strategy should also cover spectrum management models including flexible licensing; and the continued research and development (R&D) across new technologies, methods of utilising spectrum, and spectrum sharing tools.
The secretary is to work with the National Telecommunications and Information Administration (NTIA) and in consultation with the Federal Communications Commission (FCC), Office of Management and Budget (OMB), and Office of Science and Technology Policy (OSTP) on the strategy, which should also see them:
"Build a secure, automated capability to facilitate assessments of spectrum use and expedite coordination of shared access among federal and non-federal spectrum stakeholders; and improve the global competitiveness of United States terrestrial and space-related industries and augment the mission capabilities of federal entities through spectrum policies, domestic regulations, and leadership in international forums."
Within 180 days, executive departments and agencies must also report to the secretary on their predicted spectrum requirements in future and review their current spectrum assignments and usage; and the Director of the OSTP must report to the president on the expected spectrum demands of new technologies, as well as recommendations on R&D priorities across spectrum access and efficiency.
Also within 180 days, and then annually, the secretary, NTIA, OMB, OSTP, and FCC must report to the president via the Assistant to the President for National Security Affairs and the Director of the National Economic Council on "the status of existing efforts and planned near- to mid-term spectrum repurposing initiatives".
The memorandum also sets up a Spectrum Strategy Task Force, to be co-chaired by the US government CTO and Director of the National Economic Council and contain representatives from the OMB, OSTP, National Security Council, National Space Council, and Council of Economic Advisers.
"The Spectrum Strategy Task Force shall work with the secretary and the NTIA in coordinating implementation of this memorandum. In carrying out its coordination functions, the Spectrum Strategy Task Force shall consult with the FCC," the memorandum adds.
The unveiling of the spectrum strategy and taskforce follows calls from wireless carriers for greater access to 5G spectrum, with 5G Americas president Chris Pearson last month saying the lack of spectrum availability -- particularly in the mid-band, because 3.5GHz is going to be a global 5G band -- is a "big concern" that could see the US fall behind.
"5G is a race that everyone should win," Pearson told ZDNet in September.
"And when everyone wins, it means that the customer wins, whether you're a business customer or a consumer customer. But we're all only going to win if we get spectrum out there and cell site density."
Nokia's North America CTO Mike Murphy agreed that China, Korea, and Japan are all bringing mid-band spectrum to market a lot sooner than the US.
"If you don't have mid-band, like the US, what does that mean? It probably means you're going to have a little bit spotty millimetre-wave just because of the cost and how long it takes to get sites," Murphy told ZDNet.
"You'll have this low-band, which is mostly refarming LTE, which gives you the icon but maybe not the true meaning of a 5G service, so you may not get as good a nationwide experience as the countries that auction off mid-band from day one."
Earlier this year, leaked documents from the Trump Administration had shown it was considering setting standards for a secure nationwide 5G network to be used by both civilians and military weapons, in addition to signing up allies to help deploy 5G to developing nations in order to "inoculate" them against China.
The US has since barred Huawei and China Mobile from taking part in telecommunications infrastructure due to national security concerns.
It's still early days for 5G services, but as they're being trialed and deployed, they're on track to have a far-reaching impact for both consumers and businesses.
Chinese government denies NYT report that it's spying on President Trump's mobile calls.
More surveillance orders were denied during President Donald Trump's first year in office than in the court's history.
The sprawling 68-page document included a brief list of action items that aim to improve the country's approach to cybersecurity.
Trump's FCC bets big on 5G: Here's how it will change the US economy forever (TechRepublic)
The FCC hopes to speed development of 5G initiatives in a move that Chairman Ajit Pai said could lead to new jobs and $500B of economic growth.
How cybersecurity will evolve in a 5G connected world (TechRepublic)
A panel of cybersecurity and tech professionals gathered at the 2018 AT&T Business Summit to discuss the future of 5G security.
| english |
Pakistan will take on the Netherlands in the Super-12 match of the ICC T20 World Cup 2022 at the Optus Stadium in Perth. This is an important match for Pakistan after their defeat against Zimbabwe. The Pitch at the Perth has been a brilliant one for the pacers, and yet again the pacers will play an important part at the bouncy track in Perth.
Pakistan lost their last match against Zimbabwe, and all the remaining games are do or die for them. Babar Azam and Mohammad Rizwan have failed to deliver so far in the tournament, and the eyes will be on them yet again in this match. The bowlers of the side have done well in the tournament.
The Netherlands qualified for the Super-12 stage, and this itself is a huge achievement for them. They would just want to give good competition to Pakistan in this match.
The track at the Optus Stadium in Perth has been great for the pacers so far, and again they will enjoy bowling at this very surface. There is an extra amount of bounce available at this surface, and they will again be deadly at this very venue. The track at Perth is one of the most bounciest tracks in the world.
A total of 3 matches have been played here in the T20 World Cup 2022 here, and the average 1st innings score has been just 133 runs which proves that the bowlers have dominated at the Optus Stadium so far in the tournament. Both Pakistan and the Netherlands have some brilliant pacers in their ranks.
Although, overall this track has been really good for batting in the Big Bash League matches. Australia and England also faced each other before the T20 World Cup here, and it was a high-scoring encounter as well. The boundaries of this stadium are not huge as well, and the batters can take advantage of it.
Both captains would want to bowl first after winning the toss, and the pacers of both sides will enjoy the conditions upfront. It will be interesting to see if Shaheen Afridi can get some rhythm in this match.
| english |
<filename>gtas-parent/gtas-parsers/src/main/java/gov/gtas/parsers/omni/util/DateHelper.java
/*
* All GTAS code is Copyright 2020, The Department of Homeland Security (DHS), U.S. Customs and Border Protection (CBP).
* Please see LICENSE.txt for details.
*/
package gov.gtas.parsers.omni.util;
public class DateHelper {
public static String convertIntegerToAgeBin(Integer inputAge) {
// NOTE: The ageBin range is in the form: "lowerBound - upperBound" with the
// lowerBound inclusive and the upperBound excluded
String ageBin = "";
int age = inputAge.intValue();
if (age < 20) {
ageBin = "0-20";
} else if (age >= 20 && age < 25) {
ageBin = "20-25";
} else if (age >= 25 && age < 30) {
ageBin = "25-30";
} else if (age >= 30 && age < 35) {
ageBin = "30-35";
} else if (age >= 35 && age < 40) {
ageBin = "35-40";
} else if (age >= 40 && age < 45) {
ageBin = "40-45";
} else if (age >= 45 && age < 50) {
ageBin = "45-50";
} else if (age >= 50 && age < 55) {
ageBin = "50-55";
} else if (age >= 55 && age < 60) {
ageBin = "55-60";
} else {
ageBin = "60-100";
}
return ageBin;
}
}
| java |
<filename>starboi/src/pages/page-anecdotes/anecdotes.json<gh_stars>1-10
[
{
"name": "The time Chandler found a data error maliciously added by a coworker.",
"date": "August 14, 1996",
"employer": "IBM",
"notes": "",
"situation": "Chandler was working at IBM on a project related to measuring ocean depth.",
"obstacle": "A coworker maliciously added incorrect data into an Excel file. This almost killed a diver, who was impacted by running low on oxygen!",
"task": "Chandler was responsible for consuming measurement data and supply chain cost info, then determining optimal spend on scuba gear and oxygen tanks.",
"action": "Chandler worked with HR to report the issue, with supply chain to correct the order quantity, and maintained professional relationship w coworker through resolution.",
"result": "Higher spend on scuba stuff, but lives saved, and ultimately prevented possible $1.29M in employee lawsuit damages."
},
{
"name": "<NAME>",
"date": "August 14, 1997",
"employer": "IBM",
"notes": "foobar",
"situation": "Chandler was working at IBM on a project related to measuring ocean salinity.",
"obstacle": "A coworker maliciously added incorrect data into an Excel file. This almost killed a diver, who was impacted by running low on oxygen!",
"task": "Chandler was responsible for consuming measurement data and supply chain cost info, then determining optimal spend on scuba gear and oxygen tanks.",
"action": "Chandler worked with HR to report the issue, with supply chain to correct the order quantity, and maintained professional relationship w coworker through resolution.",
"result": "Higher spend on scuba stuff, but lives saved, and ultimately prevented possible $1.29M in employee lawsuit damages."
}
]
| json |
// Copyright (c) 2008-2010 Kent State University
// Copyright (c) 2011-2012 Texas A&M University
//
// This file is distributed under the MIT License. See the accompanying file
// LICENSE.txt or http://www.opensource.org/licenses/mit-license.php for terms
// and conditions.
#include <cassert>
#include <iostream>
#include <vector>
#include <origin/sequence/algorithm.hpp>
using namespace std;
using namespace origin;
int
main ()
{
using V = vector<int>;
V v{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
auto f = v.begin ();
auto l = v.end ();
const V &cv = v;
auto cf = cv.begin ();
auto cl = cv.end ();
V sub = { 7, 8, 9 };
static_assert (Same<decltype (search (v, sub)), V::iterator> (), "");
static_assert (Same<decltype (search (cv, sub)), V::const_iterator> (), "");
assert (search (v, sub) == search (f, l, sub.begin (), sub.end ()));
assert (search (cv, sub) == search (cf, cl, sub.begin (), sub.end ()));
static_assert (Same<decltype (search_n (v, 1, 5)), V::iterator> (), "");
static_assert (Same<decltype (search_n (cv, 1, 5)), V::const_iterator> (),
"");
assert (search_n (v, 1, 5) == search_n (f, l, 1, 5));
assert (search_n (cv, 1, 5) == search_n (cf, cl, 1, 5));
}
| cpp |
{"generated_at": "2017-01-27T09:37:36.879905", "required_by": ["gilliam-aws"], "requires": ["requests", "python-circuit"], "package": "gilliam-py"} | json |
// data is a json, header is for index.js orientation
// returns a promise
async function postData(data, header){
let options = {
method: 'POST',
headers: { "Content-type": "application/json; charset=UTF-8" },
body: JSON.stringify(data)
}
try {
const response = await fetch(header, options);
if(!response.ok) {
let res = await response.json();
showErrorBanner(res.error.message, 5);
console.log(res.error.message);
return res;
} else return await response.json();
} catch(e) { console.error('postData:', e); }
}
// for Event.edit() event listener
async function submitEventEdit(formEvent, form, eventId){
formEvent.preventDefault();
let dbUpdateJson = { event_id: eventId };
dbUpdateJson = getJsonFromForm(dbUpdateJson, form);
if(!dbUpdateJson) return;
postData(dbUpdateJson, '/eventUpdate');
resetSchedule();
}
function submitEventCreation(formEvent, form) {
formEvent.preventDefault();
dbInsertJson = getJsonFromForm({}, form);
if(!dbInsertJson) return;
postData(dbInsertJson, '/eventInsert');
resetSchedule();
}
// for Event.delete() event listener
async function submitEventDelete(eventId){
let dbDeleteJson = { event_id: eventId };
postData(dbDeleteJson, '/eventDelete');
resetSchedule();
}
function getJsonFromForm(json, form) {
json.event_name = form.elements[0].value;
json.start = form.elements[1].value;
json.end = form.elements[2].value;
json.start_day = form.elements[3].value;
json.period = form.elements[4].value;
let isJsonValid = validateJson(json);
if(!isJsonValid) return undefined;
return json;
}
| javascript |
సభాపతి ఉప సభాపతి
అధ్యక్షుల పేర్ల పట్టిక
ప్రత్యేక కార్యదర్శి కార్యదర్శి
సంయుక్త కార్యదర్శులు
ఉప కార్యదర్శులు
సహాయ కార్యదర్శులు
ఛప్ రిపోర్టర్
(ఆంధ్రప్రదేశ్ శాసనసభ) ప్రధాన అధికారులు
శ్రీ యనమల రామకృష్ణుడు శ్రీ ఎన్. మహమ్మద్ ఫరూక్ శ్రీ పి చంద్రశేఖర్ శ్రీమతి కె. ప్రతిభా భారతి డా. అబ్దుల్ రెహమాన్, ఎస్ శ్రీ డి.ఎస్-రెడ్యానాయక్ శ్రీ డి రాజగోపాల్ సి.వెంకటేశన్ శ్రీ ఎస్. డి · కమలాకర్ శ్రీ టి.వి శర్మ
శ్రీ కె · తులాజనందసింగ్ శ్రీమతి టి. అంజనీబాయి
శ్రీ టి వి - సత్యనారాయణ
శ్రీ కె · పి · డేవిడ్ జానకన్ శ్రీ ఆర్. భాస్కరన్
శ్రీ లెకూర్ రెహమాన్ అన్సారి శ్రీ ఆర్. అంజయ్య
శ్రీ సయ్యద్ అహమద్
శ్రీ ఎస్. వి. రామిరెడ్డి శ్రీమతి వి · జయకుమారి శ్రీమతి ఇందిరాగాంధి శ్రీ పి కాశిరాజు
శ్రీ కె · హరినారాయణ రావు
శ్రీ పి వెంకటరామారావు
శ్రీ ఎమ్. ఎ . సిద్దిఖీ
శ్రీ ఎస్ ఆర్ సి · నర్సరాజు
శ్రీ బి పద్మారెడ్డి
శ్రీ మహమ్మద్ దావూద్ అలీ శ్రీ ఎస్. రాజ సదారామ్
ఆంధ్రప్రదేశ్ శాసనసభ చర్చలు
అధికార నివేదిక
(పదునాల్గవ సమావేశము: ఎనిమిదవ రోజు)
నోమవారము, జూలై 27, 1998
(సభ ఉదయం 9:00 గంటలకు సమావేశమైనది:)
(గౌరవ సభాపతి అధ్యక్ష స్థానములో వున్నారు.) సభా కార్యక్రమము వాయిదా తీర్మానముల అనుమతి గురించి:
శ్రీ పువ్వాడ నాగేశ్వరరావు (ఖమ్మం):- అధ్యకాష్ శ్రీ పి. జనార్శన్రెడ్డి (ఖ్నెరతాబాద్) :- అధ్యక్ష
(కాంగ్రెస్, సి.పి.ఐ: సి.పి.ఎం., ఎం., ఐ.ఎం. మరియు శ్రీమతి ఎన్. లక్ష్మీపార్వతి తమ తమ స్థానాలలో నిలబడి అంతరాయం కల్పించసాగారు)
శ్రీ పి. జనార్కన్రెడ్డి:- ఈ రాష్ట్రంలో శాంతిభద్రతలు లేవు. సి.ఎం. ఇంటి దగ్గరే దారుణ హత్య జరిగింది .
శ్రీ పాటూరు రామయ్య (నిడుమోలు) :- నిత్యావసరవస్తువుల ధరల గురించి సి.ఎం. స్టేట్మెంట్ ఇస్తానని హామీ ఇచ్చారు. అది చేయలేదు. నిత్యావసర వస్తువుల ధరలు రోజు రోజుకి పెరిగిపోతున్నాయి.
MR. SPEAKER:- I have received five Adjournment Motions. I will read out first:
1. Adjourment Motion given notice of by S/Sri Puvvada Nageswara Rao, Ch. Rajeswara Rao, Vanka Satyanarayana, M. Anjaneyulu, Ch. Vittal Reddy, K. Subba Raju, K. Ramakrishna, D. Chinna Mallaiah, M.B. Chowhan, U. Narayana Rao, G.M.N.V. Prasad, V. Abbaiah, G. Demuđu, G. Yadagiri Reddy, G. Mallesh, P. Saraiah, B. Pullaiah with regard to the nonpayment of salaries to the staff of Andhra Pradesh News, Newspaper has been disallowed.
సభాకార్యక్రమము .
2. Adjournment Motion given notice of by S/Sri P.Janardhan Reddy, M.Kodanda Reddy, Gade Venkat Reddy, Kanna Laxminarayana J.C.Divakar Reddy, Dr.D.L. Ravindra Reddy, D.Nagender, K.B.Suresh Reddy, M. Sashidhar Reddy, E. Pratap Reddy, T. Jeevan Reddy, N. Varadarajula Reddy, Somepally Sambaiah, Y.S. Vivekananda Reddy, M. Shikamani, Devineni Rajasekhar, N. Venkata Rama Raju, R. Damodar Reddy, G. Muddu Krishnama Naidu, M. Narsimhulu, Kothakota Prakash Reddy, K. Rambhupal Reddy, Gade Lingappa, M. Narayana Reddy and Smt. Jyothi Devi with regard to the roberry by decoits and killing of Sri Haricharan Agarwal, a Businessman, on Friday night at Jubili: Hills in the vicinity of the Hon'ble Chief Minister's residence and also increasing decoits in and around the city and for the failure of the Government in maintaining law and order has been disallowed.
3. Adjournment Motion given notice of by Smt. N. Laxmi Parvathi, Sri H. Appaiah Dora and Sri T.S.L. Naicker with regard to the day to day increase of corruption in the Health, Medical and Family Welfare Department by Dr. P. Rama Rao, who is the main responsible person in collecting huge amounts has been disallowed.
4. Adjournment Motion given notice of by S/Sri Pathuri . Ramayya, Narra Raghava Reddy, Jakka Venkaiah, M.A. Gafvoor, N. Narsimha Reddy, N. Rama Mohan Rao, D. Rajagopal, Ch. Raja
Reddy, Kunja Bojji, K. Ramulu, 5. Venkata Veeraiah, J. Ranga Reddy, T. Chenchaiah and Smt. P. Bharathi with regard to the promise made by the Hon'ble Chief Minister on 24-07-1998 for making a statement in the House on the rise in prices of essential commodities since the people are anxiously waiting to know the steps taken by the Government has been disallowed; and
5. Adjournment Motion given notice of by Sri Asaduddin Owaisi and Sri Mumtaz Ahmed Khan with regard to the nonimplementation of the Forth Report of the Committee on
Petitions concerning the issuesof Ex-servicemen who are residing since 70 years at Band Lines, A.C.Guards, Masab Lines, Mohammadi Lines and Banyari Darwaja Lines has been disallowed.
I will personally look into it as it is pertaining to the Committee on Petitions. Once the report is submitted to the Government, the Government has to implement it.
Sri Asaduddin Owaisi:- O.K. Sir.
శ్రీమతి ఎన్. లక్ష్మీపార్వతి (పాతపట్నం):- సార్, నేను కూడా నోటీసు ఇచ్చాను. దయచేసి చర్చకు అనుమతించండి.
శ్రీ పాటూరు రామయ్య: సార్, ప్రజలు గగ్గోలు పెడుతున్నారు. అన్ని తరగతుల ప్రజలు బాధపడుతున్నారు ..
శ్రీమతి ఎన్- లక్ష్మీపార్వతి :- కొట్లాది రూపాయల ప్రభుత్వ ధనాన్ని దుర్వినియోగం చేస్తున్నారు. మెడికల్ అండ్ హెల్త్ మినిష్టర్ ఈ విధంగా చేస్తున్నారు...
Mr. Speaker:- During Zero Hour, you can raise.
శ్రీమతి ఎన్. లక్ష్మీపార్వతీ:- జీరో అవర్లో మినిస్టర్గారి పేరు మెన్షన్ చేయకూడదని ఒక ప్రక్క మీరు చెపుతున్నారు.
శ్రీ పాటూరి రామయ్య:- అన్ని తరగతుల ప్రజలు బాధపడుతున్నారు. అసలు ప్రభుత్వం ఏమి చర్యలు తీసుకొంటున్నదో చెప్పమనండి.
Mr. Speaker:- After Question Hour, I will ask the Government to give a statement.
శ్రీ పి జనార్దన్ రెడ్డి :- సి.ఎం ఇంటి దగ్గరే మర్మర్ జరిగింది.
Mr. Speaker:- Today we have to complete the agricultural policy and after that we have to take-up law and order problem.
శ్రీ పి. జనార్ధన్ రెడ్డి : సార్, ఇది చూడండి. సి.ఎం ఇంటి దగ్గరే మర్కర్
| english |
{
"ping": "lib.pas.core.PingService",
"tables": "lib.pas.core.GenericTableService",
"person": { "class": "api.logic.crm.CustomerBE", "singleton": true }
}
| json |
import ITransformer from './transformer';
export default class JsonToJsonTransformer implements ITransformer {
private readonly supportedType = 'json';
public supports(type: string): boolean {
return type.toLowerCase() === this.supportedType;
}
public transform(source: { [key: string]: string[] }): { [key: string]: string[] } {
return source;
}
}
| typescript |
<gh_stars>0
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
/*upper part it will removes all the defaults styles applied by the browser by using upper code*/
body{background: #FFFFFF;}
.main_wrapper{
width: 1000px;
height: auto;
margin:auto;
}
#header{
background-repeat: no-repeat;
width: 1000px;
height: 129px;
background-image: url("../images/admin_header.png");
border-bottom: 5px double orange;
}
#left{
overflow: auto;
background-repeat: no-repeat;
width: 795px;
height: 500px;
background-image: url("../images/admin_body.png");
float: left;
}
#right{
width: 200px;
height: 680px;
float: right;
border-left: 5px groove orange;
background: white;
}
#right a{
text-align: center;
margin: 5px 5px 5px 5px;
text-decoration: none;
font-size: 18px;
font-family: palatino;
border: 2px solid black;
background: #35B2FF;
color: white;
padding: 6px;
display: block;
}
#right a:hover{
text-decoration: underline;
font-weight: bolder;
} | css |
{
"templmd5": "523d4615240572e66d3c9373d01f37cd",
"number": "1951",
"title": "Fondazione Fratelli San Francesco d’Assisi #Milano cerca volontari per consegna farmaci",
"BACKCOLOR": "black",
"FRONTCOLOR": "white",
"filemd5": "ee87c92ed747f6b7029fac2d320acf81"
}
| json |
const router = require("express").Router();
const { SingleFood } = require("../db/models");
module.exports = router;
router.get("/:date", async (req, res, next) => {
try {
if (req.user) {
const allfoods = await SingleFood.findAll({
where: { date: req.params.date, userId: req.user.id }
});
if (!allfoods) res.sendStatus(204);
else res.json(allfoods);
}
} catch (error) {
next(error);
}
});
router.delete("/:foodId/:date/:mealType", async (req, res, next) => {
try {
if (req.user) {
const toBeDestroyed = await SingleFood.findOne({
where: {
foodId: req.params.foodId,
date: req.params.date,
mealType: req.params.mealType,
userId: req.user.id
}
});
console.log(toBeDestroyed);
if (!toBeDestroyed) res.sendStatus(204);
else {
console.log(toBeDestroyed);
await toBeDestroyed.destroy();
res.json(toBeDestroyed);
}
}
} catch (error) {
next(error);
}
});
router.put("/edit", async (req, res, next) => {
try {
if (req.user) {
const { foodId, date, mealType, servings } = req.body;
console.log(req.body);
const toBeUpdated = await SingleFood.findOne({
where: {
foodId: foodId,
date: date,
mealType: mealType,
userId: req.user.id
}
});
if (!toBeUpdated) res.sendStatus(204);
else {
toBeUpdated.servings = +servings;
await toBeUpdated.save();
res.json(toBeUpdated);
}
}
} catch (error) {
next(error);
}
});
router.post("/add", async (req, res, next) => {
try {
if (req.user) {
const {
mealType,
foodId,
date,
foodName,
calories,
carbs,
fats,
protein,
cholesterol,
fiber,
potassium,
sodium,
sugar,
brand,
servingSize,
servings
} = req.body;
console.log("body", req.body);
const isRecordedItem = await SingleFood.findOne({
where: {
foodId: foodId,
date: date,
mealType: mealType,
userId: req.user.id
}
});
if (isRecordedItem) {
isRecordedItem.servings = +servings;
await isRecordedItem.save();
res.json(isRecordedItem);
} else {
const newItem = await SingleFood.create({
mealType,
foodId,
date,
foodName,
calories,
carbs,
fats,
protein,
cholesterol,
fiber,
potassium,
sodium,
sugar,
brand,
servingSize,
servings,
userId: req.user.id
});
if (!newItem) res.sendStatus(404);
else res.json(newItem);
}
}
} catch (error) {
console.log("route", error);
next(error);
}
});
| javascript |
package org.codeandmagic.android;
import org.codeandmagic.android.R;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.TextView;
public class HintActivity extends Activity {
private static final String TAG = "hintactivity";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle extras = getIntent().getExtras();
String nodeID = extras.getString("nodeID");
String description = extras.getString("description");
boolean stateComplete = extras.getBoolean("statecomplete");
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.hintactivity);
TextView titleLabel = (TextView)findViewById(R.id.lblPoint);
titleLabel.setText(nodeID);
TextView authorLabel = (TextView)findViewById(R.id.lblProgress);
if(stateComplete)
{
authorLabel.setText("Trail is complete!");
}
TextView descriptionLabel = (TextView)findViewById(R.id.lblDescription);
descriptionLabel.setText(description);
Log.d(TAG, "Activity Created");
}
public void btnReturnPressed(View view) {
finish();
}
}
| java |
Surrey batsman Ollie Pope has been added to the England Test squad for the tour of India, the England and Wales Cricket Board said in a statement today.
“Pope has fully recovered from a left shoulder injury sustained in August 2020 against Pakistan. The England medical team are satisfied that he is available for selection," read the statement.
The 23-year-old has practised with the full squad over the past two days. England will have their final practice at the MA Chidambaram Stadium, Chennai tomorrow ahead of the first Test starting on Friday.
Pope had initially been ruled out of action for up to four months after he sustained the injury in August while saving a boundary in the third test against Pakistan in Southampton.
He had previously missed three months of cricket after dislocating the same shoulder playing for Surrey.
The first two matches of the four-test series will be played in Chennai before the teams travel to Ahmedabad for the last two games. India beat the touring England side 4-0 in 2016-17 before losing 4-1 in England in 2018. | english |
{
"name": "lootr",
"version": "0.0.3",
"description": "A simple rpg-like looting system",
"main": "index.js",
"scripts": {
"test": "nodeunit ./test.js"
},
"repository": {
"type": "git",
"url": "https://github.com/vincent/lootr.git"
},
"keywords": [
"game",
"rpg",
"loot"
],
"author": "<NAME> <<EMAIL>>",
"license": "MIT",
"bugs": {
"url": "https://github.com/vincent/lootr/issues"
},
"homepage": "https://github.com/vincent/lootr",
"dependencies": {
},
"devDependencies": {
"nodeunit": "^0.9.0"
}
}
| json |
<gh_stars>0
{"angular-material.css":"sha256-FKwkBiDGFecH3EgXmbv/I0pkEP3VIAGxdCMW0ot0wRY=","angular-material.js":"sha256-sIwYFvhCdrJeZOYSaAddadwkO5EfvhN5v48l9T1ytxo=","angular-material.min.css":"sha256-7G/2sRgH9mx2zbSaBnfA0Zy/0QnsqMKWbGYXD2FBgQY=","angular-material.min.js":"sha256-J571q3MCl11w29RM27kxbahMnOmMS+BpBByN3Q/XxC0="} | json |
mod state;
mod models;
mod routes;
use tokio::sync::mpsc;
use actix_web::{web, App, HttpServer};
const DEFAULT_MESSAGE_CAPACITY: usize = 32;
pub async fn start_web_server(host_addr: &str, port_number: u16) {
log::info!("Starting the web server on {} address on {} port....", host, port_number);
let (tx, rx) = mpsc::channel(DEFAULT_MESSAGE_CAPACITY);
let mut state = state::State::new(rx);
let state = tokio::spawn(async move {
state.run().await;
});
let _ = HttpServer::new(move || {
App::new()
.app_data(web::Data::new(tx.clone()))
.service(routes::list_todos)
.service(routes::create_todo)
.service(routes::delete_todo)
.service(routes::update_todo)
})
.bind((host_addr, port_number)).unwrap()
.run().await;
state.await.unwrap();
}
| rust |
import { makeStyles } from "@material-ui/core/styles";
import onoken from "images/onoken.jpg";
import onoken2 from "images/onokensyou2.jpg";
import React from "react";
const useStyles = makeStyles({
root: {
paddingTop: "5.0vw",
fontFamily: "source-han-sans-japanese",
},
images: {
display: "flex",
alignItems: "center",
},
imageContainer: {
flex: 1,
},
image: {
width: "80%",
},
});
const AnimeTalkEvent: React.FC = () => {
const classes = useStyles();
return (
<div className={classes.root}>
<p>・2018/11 VR 小野賢章さん</p>
<div>
アニメ声優同好会主催の小野賢章さんのトークイベントにVR作成として参加させていただきました!
</div>
<div>作品名:ハリーポッターとVR</div>
<div className={classes.images}>
<div className={classes.imageContainer}>
<img src={onoken} alt="小野賢章さん" className={classes.image} />
</div>
<div className={classes.imageContainer}>
<img
src={onoken2}
alt="小野賢章さんとの全体写真"
className={classes.image}
/>
</div>
</div>
</div>
);
};
export { AnimeTalkEvent };
| typescript |
<gh_stars>0
package com.lightbend.training.coffeehouse;
import akka.actor.ActorRef;
import akka.testkit.javadsl.TestKit;
import org.junit.Test;
public class WaiterTest extends BaseAkkaTestCase {
@Test
public void sendingServeCoffeeShouldResultInCoffeeServedResponse() {
new TestKit(system) {{
ActorRef waiter = system.actorOf(Waiter.props());
waiter.tell(new Waiter.ServeCoffee(new Coffee.Akkaccino()), getRef());
expectMsgEquals(new Waiter.CoffeeServed(new Coffee.Akkaccino()));
}};
}
}
| java |
<gh_stars>0
{
"name": "easy-pad",
"version": "0.0.3",
"main": "index.js",
"author": "<NAME>",
"license": "MIT",
"dependencies": {
"eslint": "^3.8.1"
},
"description": "An easy way to pad string left side or right side.",
"keywords": "pad",
"bugs": {
"url": "https://github.com/jiminycricket/easy-pad/issues",
"email": "<EMAIL>"
},
"repository": "https://github.com/jiminycricket/easy-pad",
"scripts": {
"test": "eslint ./index.js && mocha ./test.js"
},
"devDependencies": {
"mocha": "^3.1.2"
}
}
| json |
def is_file(molecular_system):
from sabueso.forms import file_extensions_recognized
output = False
if type(molecular_system) is str:
file_extension = molecular_system.split('.')[-1].lower()
if file_extension in file_extensions_recognized:
output = 'file:'+file_extension
return output
| python |
/**
* Round
* wangxm 2018-01-07
*/
const bignum = require('@ddn/bignum-utils');
const slot = require('./slot');
const constants = require('../../constants');
const RoundChanges = require('./round-changes');
var _singleton;
class Round {
static singleton(context) {
if (!_singleton) {
_singleton = new Round(context);
}
return _singleton;
}
constructor(context) {
Object.assign(this, context);
this._context = context;
this._feesByRound = {};
this._rewardsByRound = {};
this._delegatesByRound = {};
this._unDelegatesByRound = {};
}
async prepare() {
const round = await this.calc(this.runtime.block.getLastBlock().height);
const roundStr = round.toString();
await new Promise((resolve, reject) => {
this.dao.findOne("block", {
[roundStr]: this.dao.db_str('(select (cast(block.height / ' + this.config.settings.delegateNumber + ' as integer) + (case when block.height % ' + this.config.settings.delegateNumber + ' > 0 then 1 else 0 end))) = ' + roundStr)
}, [
[this.dao.db_fnSum(''), 'fees'], //wxm block database library.dao.db_fn('sum', library.dao.db_col('totalFee'))
[this.dao.db_fnGroupConcat('reward'), 'rewards'], //wxm block database library.dao.db_fn('group_concat', library.dao.db_col('reward'))
[this.dao.db_fnGroupConcat('generator_public_key'), 'delegates'] //wxm block database library.dao.db_fn('group_concat', library.dao.db_col('generatorPublicKey'))
], (err, row) => {
if (!row) {
row = {
fees: '',
rewards: [],
delegates: []
}
}
this._feesByRound[round] = row.fees;
this._rewardsByRound[round] = row.rewards.length > 0 ? row.rewards.split(',') : [];
this._delegatesByRound[round] = row.delegates.length ? row.delegates.split(',') : [];
resolve();
});
});
}
async calc(height) {
var value = 0;
if (bignum.isGreaterThan(bignum.modulo(height, this.config.settings.delegateNumber), 0)) {
value = 1;
}
return bignum.plus(bignum.floor(bignum.divide(height, this.config.settings.delegateNumber)), value);
}
async getVotes(round, dbTrans) {
// shuai 2018-11-24
return new Promise((resolve, reject) => {
try {
this.dao.findListByGroup('mem_round', { round: round.toString() }, {
group: ['delegate', 'round'],
attributes: ['delegate', 'round', [this.dao.db_fnSum('amount'), 'amount']] //wxm block database library.dao.db_fn('sum', library.dao.db_col('amount'))
}, dbTrans, (err, data) => {
if (err) {
reject(err)
} else {
resolve(data)
}
})
} catch (e) {
reject(e)
}
})
}
async flush(round, dbTrans) {
return new Promise((resolve, reject) => {
// shuai 2018-11-21
this.dao.remove('mem_round', { round: round.toString() }, dbTrans, (err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
})
// library.dbLite.query("delete from mem_round where round = $round", { round }, cb);
});
}
async directionSwap(direction, lastBlock) {
//wxm TODO
}
async tick(block, dbTrans) {
await this.runtime.account.merge(null, {
public_key: block.generator_public_key, //wxm block database
producedblocks: 1,
block_id: block.id, //wxm block database
round: await this.calc(block.height)
}, dbTrans);
const round = await this.calc(block.height);
this._feesByRound[round] = (this._feesByRound[round] || 0);
// bignum update
// privated.feesByRound[round] += block.totalFee;
this._feesByRound[round] = bignum.plus(this._feesByRound[round], block.total_fee); //wxm block database
this._rewardsByRound[round] = (this._rewardsByRound[round] || []);
this._rewardsByRound[round].push(block.reward);
this._delegatesByRound[round] = this._delegatesByRound[round] || [];
this._delegatesByRound[round].push(block.generator_public_key);
const nextRound = await this.calc(bignum.plus(block.height, 1));
//bignum update if (round === nextRound && block.height !== 1) {
if (bignum.isEqualTo(round, nextRound) && !bignum.isEqualTo(block.height, 1)) {
this.logger.debug("Round tick completed", {
height: block.height
});
return;
}
//bignum update if (privated.delegatesByRound[round].length !== slots.delegates && block.height !== 1 && block.height !== 101) {
if (this._delegatesByRound[round].length !== this.config.settings.delegateNumber &&
!bignum.isEqualTo(block.height, 1) && !bignum.isEqualTo(block.height, this.config.settings.delegateNumber)) {
this.logger.debug("Round tick completed", {
height: block.height
});
return;
}
const outsiders = [];
//bignum update if (block.height === 1) {
if (!bignum.isEqualTo(block.height, 1)) {
var roundDelegates = await this.runtime.delegate.getDisorderDelegatePublicKeys(block.height);
for (let i = 0; i < roundDelegates.length; i++) {
if (this._delegatesByRound[round].indexOf(roundDelegates[i]) == -1) {
outsiders.push(this.runtime.account.generateAddressByPublicKey(roundDelegates[i]));
}
}
}
if (outsiders.length) {
const escaped = outsiders.map(item => `'${item}'`);
await this.runtime.account.updateAccount({
missedblocks: this.dao.db_str('missedblocks + 1')
}, { address: escaped.join(',') }, dbTrans);
}
const roundChanges = new RoundChanges(this._context, round);
for (var index = 0; index < this._delegatesByRound[round].length; index++) {
var delegate = this._delegatesByRound[round][i];
const changes = roundChanges.at(index);
let changeBalance = changes.balance;
let changeFees = changes.fees;
const changeRewards = changes.rewards;
if (index === this._delegatesByRound[round].length - 1) {
// bignum update
// changeBalance += changes.feesRemaining;
// changeFees += changes.feesRemaining;
changeBalance = bignum.plus(changeBalance, changes.feesRemaining);
changeFees = bignum.plus(changeFees, changes.feesRemaining);
}
await this.runtime.account.merge(null, {
public_key: delegate, //wxm block database
balance: changeBalance.toString(),
u_balance: changeBalance.toString(),
block_id: block.id, //wxm block database
round: await this.calc(block.height),
fees: changeFees.toString(),
rewards: changeRewards.toString()
}, dbTrans);
}
// distribute club bonus
const bonus = new RoundChanges(this._context, round).getClubBonus();
const fees = bonus.fees;
const rewards = bonus.rewards;
const BONUS_CURRENCY = constants.tokenName
this.logger.info(`DDN witness club get new bonus: ${bonus}`)
await this.runtime.account.merge(constants.foundAddress, {
address: constants.foundAddress,
balance: bignum.plus(fees, rewards).toString(), //bignum update (fees + rewards),
u_balance: bignum.plus(fees, rewards).toString(), //bignum update (fees + rewards),
fees: fees.toString(),
rewards: rewards.toString(),
block_id: block.id, //wxm block database
round: await this.calc(block.height),
}, dbTrans);
var votes = await this.getVotes(round, dbTrans);
for (var i = 0; i < votes.length; i++) {
var vote = votes[i];
let address = this.runtime.account.generateAddressByPublicKey(vote.delegate);
await this.runtime.account.updateAccount({
vote: this.dao.db_str('vote + ' + vote.amount),
}, { address }, dbTrans);
}
if (this.runtime.socketio) {
setImmediate(async () => {
try
{
await this.runtime.socketio.emit('rounds/change', {number: round});
}
catch (err)
{
this.logger.error("The socket emit error: rounds/change. " + err);
}
});
}
await this.flush(round, dbTrans)
delete this._feesByRound[round];
delete this._rewardsByRound[round];
delete this._delegatesByRound[round];
this.logger.debug("Round tick completed", {
height: block.height
});
}
async backwardTick(block, previousBlock, dbTrans) {
var done = (err) => {
if (err) {
this.logger.error(`Round backward tick failed: ${err}`);
} else {
this.logger.debug("Round backward tick completed", {
block,
previousBlock
});
}
}
await this.runtime.account.merge(null, {
public_key: block.generator_public_key, //wxm block database
producedblocks: -1,
block_id: block.id, //wxm block database
round: await this.calc(block.height)
}, dbTrans);
var round = await this.calc(block.height);
var prevRound = await this.calc(previousBlock.b_height);
this._feesByRound[round] = (this._feesByRound[round] || 0);
// bignum update
// privated.feesByRound[round] -= block.totalFee;
this._feesByRound[round] = bignum.minus(this._feesByRound[round], block.totalFee);
this._rewardsByRound[round] = (this._rewardsByRound[round] || []);
this._rewardsByRound[round].pop();
this._delegatesByRound[round] = this._delegatesByRound[round] || [];
this._delegatesByRound[round].pop();
//bignum update if (prevRound === round && previousBlock.height !== 1) {
if (prevRound === round && !bignum.isEqualTo(previousBlock.b_height, 1)) {
return done();
}
//wxm TODO 这块还有问题,也就是_unDelegatesByRound没有任何地方有赋值操作,所以length不会存在,这里待改,暂时改成下面
this._unDelegatesByRound[round] = this._unDelegatesByRound[round] || [];
this._unDelegatesByRound[round].pop();
//bignum update if (privated.unDelegatesByRound[round].length !== slots.delegates && previousBlock.height !== 1) {
if (this._unDelegatesByRound[round].length !== this.config.settings.delegateNumber && !bignum.isEqualTo(previousBlock.b_height, 1)) {
return done();
}
this.logger.warn('Unexpected roll back cross round', {
round,
prevRound,
block,
previousBlock
});
process.exit(1);
//wxm TODO 下面的代码本来没有注释,但上面直接exit了,不会走到这里,所以整个方法的逻辑还需要梳理
// FIXME process the cross round rollback
// const outsiders = [];
// async.series([
// cb => {
// //bignum update if (block.height === 1) {
// if (bignum.isEqualTo(block.height, 1)) {
// return cb();
// }
// modules.delegates.generateDelegateList(block.height, (err, roundDelegates) => {
// if (err) {
// return cb(err);
// }
// for (let i = 0; i < roundDelegates.length; i++) {
// if (privated.unDelegatesByRound[round].indexOf(roundDelegates[i]) == -1) {
// outsiders.push(modules.accounts.generateAddressByPublicKey(roundDelegates[i]));
// }
// }
// cb();
// });
// },
// cb => {
// if (!outsiders.length) {
// return cb();
// }
// const escaped = outsiders.map(item => `'${item}'`);
// // shuai 2018-11-21
// library.dao.update('mem_account', {
// missedblocks: Sequelize.literal('missedblocks - 1')
// }, { address: { '$in': escaped.join(',') } }, dbTrans, cb)
// // library.dbLite.query(`update mem_accounts set missedblocks = missedblocks - 1 where address in (${escaped.join(',')})`, (err, data) => {
// // cb(err);
// // });
// },
// cb => {
// const roundChanges = new RoundChanges(round, true);
// async.forEachOfSeries(privated.unDelegatesByRound[round], (delegate, index, next) => {
// const changes = roundChanges.at(index);
// let changeBalance = changes.balance;
// let changeFees = changes.fees;
// const changeRewards = changes.rewards;
// if (index === 0) {
// // bignum update
// // changeBalance += changes.feesRemaining;
// // changeFees += changes.feesRemaining;
// changeBalance = bignum.plus(changeBalance, changes.feesRemaining);
// changeFees = bignum.plus(changeFees, changes.feesRemaining);
// }
// modules.accounts.mergeAccountAndGet({
// public_key: delegate, //wxm block database
// balance: bignum.minus(0, changeBalance).toString(), //bignum update -changeBalance,
// u_balance: bignum.minus(0, changeBalance).toString(), //bignum update -changeBalance,
// block_id: block.id, //wxm block database
// round: modules.round.calc(block.height).toString(),
// fees: bignum.minus(0, changeFees).toString(), //bignum update -changeFees,
// rewards: bignum.minus(0, changeRewards).toString() //bignum update -changeRewards
// }, dbTrans, next);
// }, cb);
// },
// cb => {
// // distribute club bonus
// const bonus = new RoundChanges(round).getClubBonus();
// const fees = bonus.fees;
// const rewards = bonus.rewards;
// const BONUS_CURRENCY = constants.tokenName
// library.logger.info(`DDN witness club get new bonus: ${bonus}`)
// modules.accounts.mergeAccountAndGet({
// address: constants.foundAddress,
// balance: bignum.minus(0, fees, rewards).toString(), //bignum update -(fees + rewards),
// u_balance: bignum.minus(0, fees, rewards).toString(), //bignum update -(fees + rewards),
// fees: bignum.minus(0, fees).toString(), //bignum update -fees,
// rewards: bignum.minus(0, rewards).toString(), //bignum update -rewards,
// block_id: block.id, //wxm block database
// round: modules.round.calc(block.height).toString(),
// }, dbTrans, err => {
// cb(err);
// });
// },
// cb => {
// self.getVotes(round, (err, votes) => {
// if (err) {
// return cb(err);
// }
// async.eachSeries(votes, (vote, cb) => {
// let address = null;
// address = modules.accounts.generateAddressByPublicKey(vote.delegate)
// library.dao.update('mem_account', {
// vote: Sequelize.literal('vote + ' + vote.amount),
// }, { address }, dbTrans, cb)
// // library.dbLite.query('update mem_accounts set vote = vote + $amount where address = $address', {
// // address,
// // amount: vote.amount
// // }, cb);
// }, err => {
// self.flush(round, err2 => {
// cb(err || err2);
// });
// })
// });
// }
// ], err => {
// delete privated.unFeesByRound[round];
// delete privated.unRewardsByRound[round];
// delete privated.unDelegatesByRound[round];
// done(err)
// });
}
}
module.exports = Round; | javascript |
<filename>package.json
{
"name": "thinkjs-application",
"description": "application created by thinkjs",
"version": "1.0.0",
"scripts": {
"start": "node www/development.js",
"compile": "babel --presets es2015-loose,stage-1 --plugins transform-runtime src/ --out-dir app/ --source-maps",
"watch-compile": "node -e \"console.log('<npm run watch-compile> no longer need, use <npm start> command direct.');console.log();\"",
"watch": "npm run watch-compile"
},
"dependencies": {
"babel-runtime": "6.x.x",
"moment": "^2.15.2",
"nunjucks": "^2.2.0",
"request": "^2.76.0",
"source-map-support": "0.4.0",
"thinkjs": "2.2.x"
},
"devDependencies": {
"babel-cli": "6.x.x",
"babel-preset-es2015-loose": "6.x.x",
"babel-preset-stage-1": "6.x.x",
"babel-plugin-transform-runtime": "6.x.x",
"babel-core": "6.x.x"
},
"repository": "",
"license": "MIT"
}
| json |
An individual with an anxious attachment desires closeness and validation. But at the same time, they live in fear of being abandoned. We learn to attach to our significant others when we are children. The way our parents respond to us has a huge impact on how we will form relationships after growing up, particularly romantic relationships.
Anxious attachment style is an unhelpful way of relating because, while you believe it keeps you safe, it actually blocks you from what you probably want. At the end of the day, we desire true emotional intimacy, connection, and love.
Individuals who are anxiously attached try to find safety in various ways. Mostly, they do so in relationships. However, to heal from their wounds, sometimes we have to find safety within ourselves.
How do individuals with an anxious attachment style find safety?
It can be difficult for a person with a secure attachment style to understand the neediness displayed by an anxious partner. In fact, sometimes it can become very overwhelming for both partners.
By understanding how anxious individuals seek safety in relationships, you can move towards improving your relationship.
While seeking reassurance and validation is not a bad thing and is also very common in relationships. Anxiously attached individuals are not able to make decisions on their own. They need constant reassurance and validation from their partners.
Unfortunately, they haven't felt validated by their parents or primary caregivers for a very long time.
If an anxious person can form a relationship, they see it as the only source of love and affection. Whether it is a romantic relationship or friendship, a person with an anxious attachment style becomes overly dependent on this person. They are not able to take care of their own emotional health.
One of the most common ways in which an anxiously attached individual seeks safety is by being possessive of their 'person' or people. Since they fear abandonment or experience separation anxiety, they try to be as controlling as possible. They may stop you from hanging out with others or may experience negative feelings towards your family and friends.
"Are you mad at me?" or "Did I do something wrong?" These are some questions that an individual with an anxious attachment style is likely to ask. They are constantly vigilant if you are not in a good way or may behave negatively with them. This can be traced back to their childhood trauma.
Children are often taught not to upset others around them. This makes them hypervigilant about making mistakes.
As a consequence of their dependence on you, they may constantly demand love, affection, and attention from you. While it can be difficult to understand this endless demand, it often stems from their unmet needs. They might behave in a reactive manner if their demands are not met.
It can be easy to call a person with an anxious attachment style needy and demanding. However, it takes effort and time to understand their experiences and why they behave in specific ways. If you have an anxiously attached partner, seeking couple therapy can be a great option to work on attachment issues. Remember that you are not alone!
Healing begins with awareness of patterns keeping you stuck and understanding the root fears, worries, and beliefs that are driving you to function this way. Once you are aware, you can begin the journey of chipping away at all the negative beliefs that have kept you from stepping into secure attachment! It is possible to shift anxious attachment to secure attachment with awareness and self-work!
Janvi Kapur is a counselor with a Master's degree in applied psychology with a specialization in clinical psychology.
| english |
<filename>2017/D03/D03Q1.py
def solveQuestion(value):
n = -1
total = 0
while total < value:
n += 1
total = 4*n*n - 4*n + 1
n = n - 1
minSpiralVal = 4*n*n - 4*n + 1
difference = value - minSpiralVal
# if difference is more than n - 1
if difference < n:
return n + difference
elif difference == n:
return n
elif difference > n and difference < 2*n:
return n + difference - n
print(solveQuestion(361527))
| python |
<reponame>jsonxr/react-native-material-icons
// /src/action/rocket/materialiconssharp/24px.svg
import { createSvgIcon } from './createSvgIcon';
export const SvgRocketSharp = createSvgIcon(
`<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24">
<g>
<rect fill="none" height="24" width="24"/>
</g>
<g>
<path d="M12,2.5c0,0,4.5,2.04,4.5,10.5c0,2.49-1.04,5.57-1.6,7H9.1c-0.56-1.43-1.6-4.51-1.6-7C7.5,4.54,12,2.5,12,2.5z M14,11 c0-1.1-0.9-2-2-2s-2,0.9-2,2s0.9,2,2,2S14,12.1,14,11z M7.69,20.52c-0.48-1.23-1.52-4.17-1.67-6.87L4,15v7L7.69,20.52z M20,22v-7 l-2.02-1.35c-0.15,2.69-1.2,5.64-1.67,6.87L20,22z"/>
</g>
</svg>`
);
| typescript |
package types
import (
"fmt"
"strings"
sdk "github.com/cosmos/cosmos-sdk/types"
)
type Deposit struct {
Address sdk.AccAddress `json:"address"`
Coins sdk.Coins `json:"coins"`
}
func (d Deposit) String() string {
return fmt.Sprintf(strings.TrimSpace(`
Address: %s
Coins : %s
`), d.Address, d.Coins)
}
func (d Deposit) Validate() error {
if d.Address == nil || d.Address.Empty() {
return fmt.Errorf("address should not be nil or empty")
}
if d.Coins == nil || !d.Coins.IsValid() {
return fmt.Errorf("coins should not be nil or invalid")
}
return nil
}
type Deposits []Deposit
| go |
greytHR is a leading HR software and Payroll system with experience that spans over 20 years in India and the Middle East. Its sole objective is to enable HR departments to benefit from state-of- the-art cloud based payroll software.
As a small business, you can use greytHR to implement a payroll system and HR software in your company. It doesn’t matter if you have 5 employees or 500, greytHR is suitable for every business size. It is an end to end solution and employees can use it for self service.
A vital ingredient for a successful business is seamless operations. More so when monetary transactions are made online. In the day and age we live in, security and speed is of paramount importance. So choosing a payment gateway that lives up to the herculean demands, takes a lot of searching.
Here is what greytHR has to say for Instamojo:
We were on a quest to find ourselves the optimum payment gateway that could complement our HR & Payroll software. After much scouting, we found Instamojo. The first thing we noticed that due to its robust API, the integration process was seamless. Like a well oiled machine, it all functioned like clockwork.
There were little or no complaints from our customers and in the odd chance there was one, the support team was quick to respond.
Last but not least, finding the right quality-price balance is crucial. It works out well that Instamojo is as well balanced as it comes, offering a premium service for highly competitive rates. Our customers are satisfied too as they’re able to track their transactions real-time and with instant confirmations. To sum up, I would recommend Instamojo to anyone looking for a reliable and safe payment.
You can set up your account and start collecting payments in less than 5 minutes with Instamojo.
| english |
<reponame>pivotal-Josh-Gainey/loggregator-release
package web_test
import (
"errors"
"net/http"
"net/http/httptest"
"code.cloudfoundry.org/loggregator/rlp-gateway/internal/auth"
"code.cloudfoundry.org/loggregator/rlp-gateway/internal/web"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CfAuthMiddleware", func() {
var (
spyOauth2ClientReader *spyOauth2ClientReader
spyLogAuthorizer *spyLogAuthorizer
recorder *httptest.ResponseRecorder
request *http.Request
provider web.CFAuthMiddlewareProvider
)
BeforeEach(func() {
spyOauth2ClientReader = newAdminChecker()
spyLogAuthorizer = newSpyLogAuthorizer()
provider = web.NewCFAuthMiddlewareProvider(
spyOauth2ClientReader,
spyLogAuthorizer,
)
recorder = httptest.NewRecorder()
})
Describe("/v2/read", func() {
BeforeEach(func() {
request = httptest.NewRequest(
http.MethodGet,
"/v2/read?source_id=deadbeef-dead-dead-dead-deaddeafbeef",
nil,
)
})
It("forwards the /v2/read request to the handler if user is an admin", func() {
var baseHandlerCalled bool
baseHandler := http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
baseHandlerCalled = true
})
authHandler := provider.Middleware(baseHandler)
spyOauth2ClientReader.result = true
request.Header.Set("Authorization", "bearer valid-token")
authHandler.ServeHTTP(recorder, request)
Expect(recorder.Code).To(Equal(http.StatusOK))
Expect(baseHandlerCalled).To(BeTrue())
Expect(spyOauth2ClientReader.token).To(Equal("bearer valid-token"))
})
It("forwards the /v2/read request to the handler if non-admin user has log access", func() {
spyLogAuthorizer.result = true
var baseHandlerCalled bool
baseHandler := http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
baseHandlerCalled = true
})
authHandler := provider.Middleware(baseHandler)
request.Header.Set("Authorization", "valid-token")
// Call result
authHandler.ServeHTTP(recorder, request)
Expect(recorder.Code).To(Equal(http.StatusOK))
Expect(baseHandlerCalled).To(BeTrue())
//verify CAPI called with correct info
Expect(spyLogAuthorizer.token).To(Equal("valid-token"))
Expect(spyLogAuthorizer.sourceID).To(Equal("deadbeef-dead-dead-dead-deaddeafbeef"))
})
It("return 404 if non-admin user requests non-uuid", func() {
request = httptest.NewRequest(http.MethodGet, "/v2/read?source_id=123", nil)
spyLogAuthorizer.result = true
var baseHandlerCalled bool
baseHandler := http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
baseHandlerCalled = true
})
authHandler := provider.Middleware(baseHandler)
request.Header.Set("Authorization", "valid-token")
// Call result
authHandler.ServeHTTP(recorder, request)
Expect(recorder.Code).To(Equal(http.StatusNotFound))
Expect(recorder.Body).To(MatchJSON(`{
"error": "not_found",
"message": "resource not found"
}`))
Expect(baseHandlerCalled).To(BeFalse())
})
It("returns 404 if there's no authorization header present", func() {
var baseHandlerCalled bool
baseHandler := http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
baseHandlerCalled = true
})
authHandler := provider.Middleware(baseHandler)
authHandler.ServeHTTP(recorder, request)
Expect(recorder.Code).To(Equal(http.StatusNotFound))
Expect(recorder.Body).To(MatchJSON(`{
"error": "not_found",
"message": "resource not found"
}`))
Expect(baseHandlerCalled).To(BeFalse())
})
It("returns 404 if Oauth2ClientReader returns an error", func() {
var baseHandlerCalled bool
baseHandler := http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
baseHandlerCalled = true
})
authHandler := provider.Middleware(baseHandler)
spyOauth2ClientReader.err = errors.New("some-error")
spyOauth2ClientReader.result = true
spyLogAuthorizer.result = true
request.Header.Set("Authorization", "valid-token")
authHandler.ServeHTTP(recorder, request)
Expect(recorder.Code).To(Equal(http.StatusNotFound))
Expect(recorder.Body).To(MatchJSON(`{
"error": "not_found",
"message": "resource not found"
}`))
Expect(baseHandlerCalled).To(BeFalse())
})
It("returns 404 if user is not authorized", func() {
var baseHandlerCalled bool
baseHandler := http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
baseHandlerCalled = true
})
authHandler := provider.Middleware(baseHandler)
spyOauth2ClientReader.result = false
spyLogAuthorizer.result = false
request.Header.Set("Authorization", "valid-token")
authHandler.ServeHTTP(recorder, request)
Expect(recorder.Code).To(Equal(http.StatusNotFound))
Expect(recorder.Body).To(MatchJSON(`{
"error": "not_found",
"message": "resource not found"
}`))
Expect(baseHandlerCalled).To(BeFalse())
})
It("returns 404 if user is not admin and does not request a source ID", func() {
request = httptest.NewRequest(http.MethodGet, "/v2/read", nil)
var baseHandlerCalled bool
baseHandler := http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
baseHandlerCalled = true
})
authHandler := provider.Middleware(baseHandler)
spyOauth2ClientReader.result = false
spyLogAuthorizer.result = true
request.Header.Set("Authorization", "valid-token")
authHandler.ServeHTTP(recorder, request)
Expect(recorder.Code).To(Equal(http.StatusNotFound))
Expect(recorder.Body).To(MatchJSON(`{
"error": "not_found",
"message": "resource not found"
}`))
Expect(baseHandlerCalled).To(BeFalse())
})
})
})
type spyOauth2ClientReader struct {
token string
result bool
client string
user string
err error
}
func newAdminChecker() *spyOauth2ClientReader {
return &spyOauth2ClientReader{}
}
func (s *spyOauth2ClientReader) Read(token string) (auth.Oauth2Client, error) {
s.token = token
return auth.Oauth2Client{
IsAdmin: s.result,
ClientID: s.client,
UserID: s.user,
}, s.err
}
type spyLogAuthorizer struct {
result bool
sourceID string
token string
available []string
availableCalled int
}
func newSpyLogAuthorizer() *spyLogAuthorizer {
return &spyLogAuthorizer{}
}
func (s *spyLogAuthorizer) IsAuthorized(sourceID, token string) bool {
s.sourceID = sourceID
s.token = token
return s.result
}
func (s *spyLogAuthorizer) AvailableSourceIDs(token string) []string {
s.availableCalled++
s.token = token
return s.available
}
| go |
<reponame>egochao/transformer_with_einsum
"""
@author : Hyunwoong
@when : 2019-10-22
@homepage : https://github.com/gusdnd852
"""
import torch
# GPU device setting
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
# model parameter setting
batch_size = 64
max_len = 256
d_model = 512
n_layers = 6
n_heads = 8
ffn_hidden = 2048
drop_prob = 0.1
# optimizer parameter setting
init_lr = 1e-5
factor = 0.9
adam_eps = 5e-9
patience = 10
warmup = 100
epoch = 1000
clip = 1.0
weight_decay = 5e-4
inf = float('inf') | python |
In the ongoing MX Player series Times of Music, in which veteran and contemporary composers rearrange and perform each other’s music in front of an audience, host Vishal Dadlani introduced Viju Shah as the “king of synth sounds”.
It’s apt, considering the 61-year-old Hindi film composer’s talent for incorporating into his tunes heavily synthesised rhythm sections drawn from synthpop, deep house and new age music. These influences were most strongly felt in his soundtracks for Rajiv Rai’s thrillers. Writer-director Atul Sabharwal (Powder, Aurangzeb) has recruited Shah to compose “1980s-style synth music” for his upcoming Netflix film Class of ‘83, Shah told Scroll.in.
On the Times of Music episode of June 20, a stream of analogue blips and bloops ran through Shah’s take on Mithoon’s Tose Naina and Aankhen Teri from the movie Anwar (2007). In turn, Mithoon produced an exquisite version of Tip Tip Barsa Pani (Mohra, 1994), which gave greater prominence to the sensuality in Anand Bakshi’s lyrics than did the original’s uptempo arrangement.
While audiophiles and music nerds geek out on Shah’s technological savvy, his lasting legacy is rooted in the strength of his melodies.
Tirchi Topiwale (Tridev, 1989), Saat Samundar Paar (Vishwatma, 1992), Tip Tip Barsa Pani, and tunes from Gupt and Bade Miyan Chote Miyan (1998) are still loved, widely played, and referenced. A Tanishk Bagchi remake of Shah’s 1996 hit Aankh Marey (Tere Mere Sapne) became a chart-topper again in 2018.
Despite being fondly recalled for catchy tunes and sonic sophistication, Shah’s body of work faces allegations of plagiarism. Like his contemporaries Nadeem-Shravan and Anu Malik, Shah borrowed from Nusrat Fateh Ali Khan’s music. A riff here or a loop there was nicked from mostly contemporaneous Western electropop.
Shah’s emergence as a composer happened at a time when traditional orchestral arrangement was disappearing and making way for programmed music.
The son of Kalyanji Shah and nephew of Anandji Shah, who formed the composing duo Kalyanji-Anandji, Viju Shah worked closely with both as a music arranger since Don (1978). He saw first-hand the slow and palpable shift from acoustics to electronics in Hindi film music.
Shah’s synth work lent Kalyanji-Anandji’s latter-day soundtracks an edge, particularly for Feroz Khan’s action films Qurbaani (1980) and Jaanbaaz (1986). “Feroz Khan would sit with me like a kid and ask me to show what new sounds could be produced from this brand new toy,” Shah recalled.
It was during his years as an arranger for Kalyanji-Anandji that Shah met filmmaker Rajiv Rai. Kalyanji-Anandji composed the songs for Rai’s first film Yudh (1985), but they have a distinctive Viju Shah flavour, thanks to Rai’s strong inclination towards new sounds.
Rajiv Rai’s father, the producer Gulshan Rai, had asked Kalyanji-Anandji to compose the soundtrack for Tridev. But Rajiv Rai and Viju Shah worked on the tunes that included the future hit Tirchi Topiwale and got them approved. The film and the soundtrack were huge successes. Because of a contractual agreement, Kalyanji-Anandji were credited as composers, while Viju Shah was listed as a conductor.
It wasn’t until Gupt that both Rai and Shah came into their own. The thriller followed a brooding young man on the run after being falsely accused of killing his stepfather, while getting occasionally distracted by two seductive heroines.
Rai pushed Shah to adopt “trance and garage music” for the soundtrack. “I had so many songs for Rajiv just based on a rhythm section that he took a liking to,” Rai recalled. Perhaps that explains the range of third-party samples and riffs in the album.
While Viju Shah did find some success in romances and comedies, including Tere Mere Sapne and Bade Miyan Chote Miyan, he developed a niche in the action and thriller genres, particularly with club songs and eroticised dance numbers. Outside of Rajiv Rai’s productions, Shah had an interesting soundtrack for Ketan Mehta’s 1997 James Hadley Chase adaptation Aar Ya Paar.
After Rai stopped making films in 2004, Viju Shah’s career came to a halt too. Fitna Dil (Shikhar, 2005) was a late-career hit. Rai’s last movie Asambhav (2004) had strong splashes of EDM that went nowhere.
A good news for enthusiasts of the Shah-Rai combo: the composer said that the two have been working on a new project.
| english |
<reponame>anshsahny/MovieDB
{"ast":null,"code":"var _jsxFileName = \"/Users/anshsahny/Ansh/Web Applications/MovieDB/client/src/components/elements/SearchBar/SearchBar.js\";\nimport React, { Component } from 'react';\nimport FontAwesome from 'react-fontawesome';\nimport './SearchBar.css';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nclass SearchBar extends Component {\n constructor(...args) {\n super(...args);\n this.state = {\n value: ''\n };\n this.timeout = null;\n\n this.doSearch = event => {\n this.setState = {\n value: event.target.value\n };\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => {\n this.props.callback(this.state.value);\n }, 500);\n };\n }\n\n render() {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"rmdb-searchbar\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"rmdb-searchbar-content\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesome, {\n className: \"rmdb-fa-search\",\n name: \"search\",\n size: \"2x\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 21\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n className: \"rmdb-searchbar-input\",\n placeholder: \"Search\",\n onChange: this.doSearch,\n value: this.state.value\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 21\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 17\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 13\n }, this);\n }\n\n}\n\nexport default SearchBar;","map":{"version":3,"sources":["/Users/anshsahny/Ansh/Web Applications/MovieDB/client/src/components/elements/SearchBar/SearchBar.js"],"names":["React","Component","FontAwesome","SearchBar","state","value","timeout","doSearch","event","setState","target","clearTimeout","setTimeout","props","callback","render"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,SAAf,QAA+B,OAA/B;AACA,OAAOC,WAAP,MAAwB,mBAAxB;AACA,OAAO,iBAAP;;;AAEA,MAAMC,SAAN,SAAwBF,SAAxB,CAAkC;AAAA;AAAA;AAAA,SAC9BG,KAD8B,GACtB;AACJC,MAAAA,KAAK,EAAE;AADH,KADsB;AAAA,SAK9BC,OAL8B,GAKpB,IALoB;;AAAA,SAO9BC,QAP8B,GAOlBC,KAAD,IAAW;AAClB,WAAKC,QAAL,GAAiB;AAACJ,QAAAA,KAAK,EAAEG,KAAK,CAACE,MAAN,CAAaL;AAArB,OAAjB;AACAM,MAAAA,YAAY,CAAC,KAAKL,OAAN,CAAZ;AAEA,WAAKA,OAAL,GAAeM,UAAU,CAAC,MAAM;AAC5B,aAAKC,KAAL,CAAWC,QAAX,CAAoB,KAAKV,KAAL,CAAWC,KAA/B;AACH,OAFwB,EAEtB,GAFsB,CAAzB;AAGH,KAd6B;AAAA;;AAgB9BU,EAAAA,MAAM,GAAG;AACL,wBACI;AAAK,MAAA,SAAS,EAAC,gBAAf;AAAA,6BACI;AAAK,QAAA,SAAS,EAAC,wBAAf;AAAA,gCACI,QAAC,WAAD;AAAa,UAAA,SAAS,EAAC,gBAAvB;AAAwC,UAAA,IAAI,EAAC,QAA7C;AAAsD,UAAA,IAAI,EAAC;AAA3D;AAAA;AAAA;AAAA;AAAA,gBADJ,eAEI;AAAO,UAAA,IAAI,EAAC,MAAZ;AAAmB,UAAA,SAAS,EAAC,sBAA7B;AAAoD,UAAA,WAAW,EAAC,QAAhE;AAAyE,UAAA,QAAQ,EAAE,KAAKR,QAAxF;AAAkG,UAAA,KAAK,EAAE,KAAKH,KAAL,CAAWC;AAApH;AAAA;AAAA;AAAA;AAAA,gBAFJ;AAAA;AAAA;AAAA;AAAA;AAAA;AADJ;AAAA;AAAA;AAAA;AAAA,YADJ;AAQH;;AAzB6B;;AA4BlC,eAAeF,SAAf","sourcesContent":["import React, {Component} from 'react'\nimport FontAwesome from 'react-fontawesome'\nimport './SearchBar.css'\n\nclass SearchBar extends Component {\n state = {\n value: ''\n }\n\n timeout = null;\n\n doSearch = (event) => {\n this.setState = ({value: event.target.value})\n clearTimeout(this.timeout)\n\n this.timeout = setTimeout(() => {\n this.props.callback(this.state.value)\n }, 500)\n }\n\n render() {\n return (\n <div className='rmdb-searchbar'>\n <div className='rmdb-searchbar-content'>\n <FontAwesome className='rmdb-fa-search' name='search' size='2x'/>\n <input type='text' className='rmdb-searchbar-input' placeholder='Search' onChange={this.doSearch} value={this.state.value}/>\n </div>\n </div>\n )\n }\n}\n\nexport default SearchBar"]},"metadata":{},"sourceType":"module"} | json |
Alibaba Group, Chinas leading e-commerce company today announced, it is planning to build a network of warehouses across China and hopes to mobilize other partners to join in this effort to create an integrated logistics platform that will help elevate the quality of service to Chinese consumers and allow merchants to meet rapidly growing domestic consumption needs. Over the medium term, Alibaba Group and its financing partners will commit between RMB20 billion and RMB30 billion (US$3.01 billion to US$4.52 billion), and Alibaba Group hopes to spark a total investment of more than RMB100 billion (US$15.05 billion1) in logistics development in China by others partners in the e-commerce eco-system.
Alibaba Group’s strategy towards logistics is composed of four key parts. Initially, Taobao will continue to deepen its pursuit of the previously announced Taobao logistics initiative to enhance quality control of delivery service. The Taobao logistics initiative consists of the Taobao supply-chain management platform (e56.taobao.com) to help merchants handle inventory; logistics partnership network; and industry code of standards guiding logistics service providers. At the same time, Taobao will focus on providing relevant value-added services in accordance to product vertical-specific needs. Alibaba Group will also mobilize efforts to establish an integrated logistics platform that aims to bring together all players in the industry from warehousing to delivery. Third, Alibaba Group will invest in the establishment of a nationwide warehouse network across China in the goal of redressing the key bottleneck facing the logistics industry. Lastly, Alibaba.com (HKSE: 1688) (1688.HK) will offer warehousing facility support to small Chinese exporters.
Alibaba Group will coordinate closely with working partners in all sectors of the logistics industry to establish a national network of warehouse facilities to service the B2C industry across China. Usage of the Alibaba Group-owned warehouse facilities will be a service available to all, including partners in the logistics industry, Taobao sellers as well as independent B2C websites. Beijing/Tianjin area, the Yangtze River Delta and the Pearl River Delta were the regions initially selected by Alibaba for warehouse construction because of their proximity to major population centers. Initial plans are to establish warehousing facilities in these three regions totaling approximately 3 million square meters in size, or the equivalent of 560 American football fields of floor space (or 356 football pitches).
“Creating a network of warehouse facilities is a key tactic in our strategy to resolve the bottleneck facing the logistics industry in China. In the other areas of the logistic industry, Alibaba Group will mainly participate through investments aimed at helping our working partners to accelerate their own growth,” said Zhang Wei, senior vice president of Alibaba Group and head of its strategic investment team.
As the leading source of business for the Chinese logistics industry, Taobao recently shared that transactions per user grew 35 percent year-over-year while Taobao Mall, its dedicated B2C platform, saw its 2010 gross merchandise value quadruple over the previous year. On November 11, 2010, more than 15 million packages were sent as a result of a single-day promotional event on Taobao Mall.
Get the most important tech news in your inbox each week.
| english |
<gh_stars>10-100
package command
import (
"testing"
"github.com/quintilesims/layer0/common/models"
"github.com/quintilesims/layer0/common/testutils"
"github.com/urfave/cli"
)
func TestParsePort(t *testing.T) {
cases := []struct {
Target string
Certificate string
Expected models.Port
}{
{
Target: "80:80/tcp",
Expected: models.Port{
HostPort: 80,
ContainerPort: 80,
Protocol: "tcp",
},
},
{
Target: "80:80/http",
Expected: models.Port{
HostPort: 80,
ContainerPort: 80,
Protocol: "http",
},
},
{
Target: "8080:80/http",
Expected: models.Port{
HostPort: 8080,
ContainerPort: 80,
Protocol: "http",
},
},
{
Target: "80:80/https",
Certificate: "crt_name",
Expected: models.Port{
HostPort: 80,
ContainerPort: 80,
Protocol: "https",
CertificateName: "crt_name",
},
},
{
Target: "80:80/https",
Certificate: "arn:aws:iam::12345:server-certificate/crt_name",
Expected: models.Port{
HostPort: 80,
ContainerPort: 80,
Protocol: "https",
CertificateARN: "arn:aws:iam::12345:server-certificate/crt_name",
},
},
}
for _, c := range cases {
result, err := parsePort(c.Target, c.Certificate)
if err != nil {
t.Fatal(err)
}
testutils.AssertEqual(t, *result, c.Expected)
}
}
func TestParsePortErrors(t *testing.T) {
cases := map[string]string{
"Missing HOST_PORT": ":80/tcp",
"Missing CONTAINER_PORT": "80:/tcp",
"Missing PROTOCOL": "80:80",
"Non-integer HOST_PORT": "80p:80/tcp",
"Non-integer CONTAINER_PORT": "80:80p/tcp",
}
for name, input := range cases {
if _, err := parsePort(input, ""); err == nil {
t.Fatalf("%s: error was nil!", name)
}
}
}
func TestLoadBalancerAddPort(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Resolver.EXPECT().
Resolve("load_balancer", "name").
Return([]string{"id"}, nil)
tc.Client.EXPECT().
GetLoadBalancer("id").
Return(&models.LoadBalancer{}, nil)
port := models.Port{
HostPort: 443,
ContainerPort: 80,
Protocol: "https",
CertificateName: "cert_name",
}
tc.Client.EXPECT().
UpdateLoadBalancerPorts("id", []models.Port{port}).
Return(&models.LoadBalancer{}, nil)
flags := map[string]interface{}{"certificate": "cert_name"}
c := testutils.GetCLIContext(t, []string{"name", "443:80/https"}, flags)
if err := command.AddPort(c); err != nil {
t.Fatal(err)
}
}
func TestLoadBalancerAddPort_userInputErrors(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
contexts := map[string]*cli.Context{
"Missing NAME arg": testutils.GetCLIContext(t, nil, nil),
"Missing PORT arg": testutils.GetCLIContext(t, []string{"name"}, nil),
}
for name, c := range contexts {
if err := command.AddPort(c); err == nil {
t.Fatalf("%s: error was nil!", name)
}
}
}
func TestCreateLoadBalancer(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Resolver.EXPECT().
Resolve("environment", "environment").
Return([]string{"environmentID"}, nil)
healthCheck := models.HealthCheck{
Target: "TCP:80",
Interval: 30,
Timeout: 5,
HealthyThreshold: 10,
UnhealthyThreshold: 2,
}
ports := []models.Port{
{
HostPort: 443,
ContainerPort: 80,
Protocol: "https",
CertificateName: "cert_name",
},
{
HostPort: 8000,
ContainerPort: 8000,
Protocol: "http",
CertificateName: "",
},
}
tc.Client.EXPECT().
CreateLoadBalancer("name", "environmentID", healthCheck, ports, false, 60, true).
Return(&models.LoadBalancer{}, nil)
flags := map[string]interface{}{
"port": []string{"443:80/https", "8000:8000/http"},
"certificate": "cert_name",
"private": true,
"healthcheck-target": "TCP:80",
"healthcheck-interval": 30,
"healthcheck-timeout": 5,
"healthcheck-healthy-threshold": 10,
"healthcheck-unhealthy-threshold": 2,
"idle-timeout": 60,
"disable-cross-zone": false,
}
c := testutils.GetCLIContext(t, []string{"environment", "name"}, flags)
if err := command.Create(c); err != nil {
t.Fatal(err)
}
}
func TestCreateLoadBalancer_userInputErrors(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
contexts := map[string]*cli.Context{
"Missing ENVIRONMENT arg": testutils.GetCLIContext(t, nil, nil),
"Missing NAME arg": testutils.GetCLIContext(t, []string{"environment"}, nil),
}
for name, c := range contexts {
if err := command.Create(c); err == nil {
t.Fatalf("%s: error was nil!", name)
}
}
}
func TestDeleteLoadBalancer(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Resolver.EXPECT().
Resolve("load_balancer", "name").
Return([]string{"id"}, nil)
tc.Client.EXPECT().
DeleteLoadBalancer("id").
Return("jobid", nil)
c := testutils.GetCLIContext(t, []string{"name"}, nil)
if err := command.Delete(c); err != nil {
t.Fatal(err)
}
}
func TestDeleteLoadBalancerWait(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Resolver.EXPECT().
Resolve("load_balancer", "name").
Return([]string{"id"}, nil)
tc.Client.EXPECT().
DeleteLoadBalancer("id").
Return("jobid", nil)
tc.Client.EXPECT().
WaitForJob("jobid", testutils.TEST_TIMEOUT).
Return(nil)
c := testutils.GetCLIContext(t, []string{"name"}, map[string]interface{}{"wait": true})
if err := command.Delete(c); err != nil {
t.Fatal(err)
}
}
func TestDeleteLoadBalancer_userInputErrors(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
contexts := map[string]*cli.Context{
"Missing NAME arg": testutils.GetCLIContext(t, nil, nil),
}
for name, c := range contexts {
if err := command.Delete(c); err == nil {
t.Fatalf("%s: error was nil!", name)
}
}
}
func TestGetLoadBalancer(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Resolver.EXPECT().
Resolve("load_balancer", "name").
Return([]string{"id"}, nil)
tc.Client.EXPECT().
GetLoadBalancer("id").
Return(&models.LoadBalancer{}, nil)
c := testutils.GetCLIContext(t, []string{"name"}, nil)
if err := command.Get(c); err != nil {
t.Fatal(err)
}
}
func TestGetLoadBalancer_userInputErrors(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
contexts := map[string]*cli.Context{
"Missing NAME arg": testutils.GetCLIContext(t, nil, nil),
}
for name, c := range contexts {
if err := command.Get(c); err == nil {
t.Fatalf("%s: error was nil!", name)
}
}
}
func TestListLoadBalancers(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Client.EXPECT().
ListLoadBalancers().
Return([]*models.LoadBalancerSummary{}, nil)
c := testutils.GetCLIContext(t, nil, nil)
if err := command.List(c); err != nil {
t.Fatal(err)
}
}
func TestHealthCheck_noUpdateRequired(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Resolver.EXPECT().
Resolve("load_balancer", "env").
Return([]string{"id"}, nil)
tc.Client.EXPECT().
GetLoadBalancer("id").
Return(&models.LoadBalancer{}, nil)
c := testutils.GetCLIContext(t, []string{"env", "name"}, nil)
if err := command.HealthCheck(c); err != nil {
t.Fatal(err)
}
}
func TestHealthCheck_partialUpdateRequired(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
existingHealthCheck := models.HealthCheck{
Target: "TCP:80",
Interval: 30,
Timeout: 5,
HealthyThreshold: 2,
UnhealthyThreshold: 2,
}
tc.Resolver.EXPECT().
Resolve("load_balancer", "env").
Return([]string{"id"}, nil)
tc.Client.EXPECT().
GetLoadBalancer("id").
Return(&models.LoadBalancer{
HealthCheck: existingHealthCheck,
}, nil)
expectedHealthCheck := models.HealthCheck{
Target: "TCP:88",
Interval: 45,
Timeout: 5,
HealthyThreshold: 2,
UnhealthyThreshold: 2,
}
tc.Client.EXPECT().
UpdateLoadBalancerHealthCheck("id", expectedHealthCheck)
flags := map[string]interface{}{
"set-target": "TCP:88",
"set-interval": 45,
}
c := testutils.GetCLIContext(t, []string{"env", "name"}, flags)
if err := command.HealthCheck(c); err != nil {
t.Fatal(err)
}
}
func TestHealthCheck_userInputErrors(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
contexts := map[string]*cli.Context{
"Non-int '--set-interval' flag": testutils.GetCLIContext(t, []string{"name"}, map[string]interface{}{"set-interval": "two"}),
"Non-int '--set-timeout' flag": testutils.GetCLIContext(t, []string{"name"}, map[string]interface{}{"set-timeout": "two"}),
"Non-int '--set-healthy-threshold' flag": testutils.GetCLIContext(t, []string{"name"}, map[string]interface{}{"set-healthy-threshold": "two"}),
"Non-int '--set-unhealthy-threshold' flag": testutils.GetCLIContext(t, []string{"name"}, map[string]interface{}{"set-unhealthy-threshold": "two"}),
"Missing NAME arg": testutils.GetCLIContext(t, nil, map[string]interface{}{"set-interval": 2}),
}
for name, c := range contexts {
if err := command.HealthCheck(c); err == nil {
t.Fatalf("%s: error was nil!", name)
}
}
}
func TestLoadBalancerIdleTimeout(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Resolver.EXPECT().
Resolve("load_balancer", "lb_name").
Return([]string{"id"}, nil)
tc.Client.EXPECT().
GetLoadBalancer("id").
Return(&models.LoadBalancer{}, nil)
tc.Client.EXPECT().
UpdateLoadBalancerIdleTimeout("id", 75)
c := testutils.GetCLIContext(t, []string{"lb_name", "75"}, nil)
if err := command.IdleTimeout(c); err != nil {
t.Fatal(err)
}
}
func TestLoadBalancerIdleTimeout_userInputErrors(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
contexts := map[string]*cli.Context{
"Missing NAME arg": testutils.GetCLIContext(t, nil, nil),
"Missing TIMEOUT arg": testutils.GetCLIContext(t, []string{"name"}, nil),
}
for name, c := range contexts {
if err := command.IdleTimeout(c); err == nil {
t.Fatalf("%s: error was nil!", name)
}
}
}
func TestLoadBalancerCrossZone_noUpdateRequired(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Resolver.EXPECT().
Resolve("load_balancer", "env").
Return([]string{"id"}, nil)
tc.Client.EXPECT().
GetLoadBalancer("id").
Return(&models.LoadBalancer{}, nil)
c := testutils.GetCLIContext(t, []string{"env", "name"}, nil)
if err := command.CrossZone(c); err != nil {
t.Fatal(err)
}
}
func TestLoadBalancerCrossZone_enableCrossZone(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Resolver.EXPECT().
Resolve("load_balancer", "env").
Return([]string{"id"}, nil)
tc.Client.EXPECT().
GetLoadBalancer("id").
Return(&models.LoadBalancer{}, nil)
tc.Client.EXPECT().
UpdateLoadBalancerCrossZone("id", true).
Return(&models.LoadBalancer{}, nil)
c := testutils.GetCLIContext(t, []string{"env", "name"}, map[string]interface{}{"enable": true})
if err := command.CrossZone(c); err != nil {
t.Fatal(err)
}
}
func TestLoadBalancerCrossZone_disableCrossZone(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
tc.Resolver.EXPECT().
Resolve("load_balancer", "env").
Return([]string{"id"}, nil)
tc.Client.EXPECT().
GetLoadBalancer("id").
Return(&models.LoadBalancer{}, nil)
tc.Client.EXPECT().
UpdateLoadBalancerCrossZone("id", false).
Return(&models.LoadBalancer{}, nil)
c := testutils.GetCLIContext(t, []string{"env", "name"}, map[string]interface{}{"disable": true})
if err := command.CrossZone(c); err != nil {
t.Fatal(err)
}
}
func TestLoadBalancerCrossZone_userInputErrors(t *testing.T) {
tc, ctrl := newTestCommand(t)
defer ctrl.Finish()
command := NewLoadBalancerCommand(tc.Command())
contexts := map[string]*cli.Context{
"Missing NAME arg": testutils.GetCLIContext(t, nil, nil),
"Both '--enable' and '--disable' flags passed": testutils.GetCLIContext(t, []string{"name"}, map[string]interface{}{"enable": true, "disable": true}),
}
for name, c := range contexts {
if err := command.CrossZone(c); err == nil {
t.Fatalf("%s: error was nil!", name)
}
}
}
| go |
<reponame>AaronDeMent/BlobFish
import { lookupAddress, processData } from "../app"
describe('get address results ', () => {
it('finds good data on valid URL', () => {
lookupAddress('google.com', (response) => {
expect(response).toContain("Google LLC")
})
})
it('finds good data on valid IP address', () => {
lookupAddress('8.8.8.8', (response) => {
expect(response).toContain("American Registry for Internet Numbers")
})
})
})
describe('Process address result', () => {
it('Removes entries with Registrar', () => {
expect(processData("Registrar")).not.toContain("Registrar")
})
it('removes entries with Domain Status', () => {
expect(processData("Domain Status")).not.toContain("Domain Status")
})
it('removes entries with Domain Status', () => {
expect(processData("Domain Status")).not.toContain("Domain Status")
})
it('removes entries with DNSSEC', () => {
expect(processData("DNSSEC")).not.toContain("DNSSEC")
})
it('returns error code with an invalid address', () => {
expect(processData("% This is the RIPE Database query service.")).toBe("ERROR_BAD_ADDRESS")
})
})
| javascript |
He gave the statement before Judge KM Imrul Kayes of the Dhaka Metropolitan Magistrate Court.
“No arms were recovered from me, I’m completely innocent and expecting justice from the court,” Shahed said.
The court fixed September 17, to present arguments of the state.
Recording testimonies of the witnesses in the case were completed on Tuesday.
Earlier, members of Rab arrested Shahed from a bordering area of Satkhira on July 15.
Rab members also recovered a firearm, some bullets and foreign currencies from his possession.
Law enforcers raided Mirpur and Uttara branches of Regent Hospital on July 6 on charge of issuing fake Covid-19 certificates and charging the admitted patients exorbitant fees.
The Regent Group head office along with both the hospitals was sealed off and 16 people, including the chairman, were sued on charge of issuing fake coronavirus test reports.
| english |
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ProductsComponent } from './products.component';
const routes = [
{
path: 'products',
component: ProductsComponent
},
];
@NgModule({
imports: [ RouterModule.forRoot(routes) ],
exports: [ RouterModule ]
})
export class AppRoutingModule {}
| typescript |
<reponame>lwngt/intrapps<filename>api/app/src/api_conf/api.json
{
"web_url": "https://localhost",
"base_url": "https://localhost:8181",
"api_log_output": false
}
| json |
<gh_stars>0
/*
Copyright 2016 <NAME>, Imperial College London
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 OCTREE_COLLISION_HPP
#define OCTREE_COLLISION_HPP
#include "../node.hpp"
#include "../octree.hpp"
#include "aabb_collision.hpp"
namespace se {
template<typename T>
using VoxelBlockType = typename T::VoxelBlockType;
namespace geometry {
enum class collision_status {
occupied,
unseen,
empty
};
/*! \brief Implements a simple state machine to update the collision status.
* The importance order is given as follows in ascending order:
* Empty, Unseen, Occupied.
* \param previous_status
* \param new_status
*/
inline collision_status update_status(const collision_status previous_status,
const collision_status new_status) {
switch(previous_status) {
case collision_status::unseen:
if(new_status != collision_status::occupied)
return previous_status;
else
return new_status;
break;
case collision_status::occupied:
return previous_status;
break;
default:
return new_status;
break;
}
}
/*! \brief Perform a collision test for each voxel value in the input voxel
* block. The test function test takes as input a voxel value and returns a
* collision_status. This is used to distinguish between seen-empty voxels and
* occupied voxels.
* \param block voxel block of type FieldType
* \param test function that takes a voxel and returns a collision_status value
*/
template <typename FieldType, template <typename FieldT> class VoxelBlockT, typename TestVoxelF>
collision_status collides_with(const VoxelBlockT<FieldType>* block,
const Eigen::Vector3i bbox_coord, const Eigen::Vector3i size, TestVoxelF test) {
collision_status status = collision_status::empty;
const Eigen::Vector3i block_coord = block->coordinates();
int x, y, z, block_size;
block_size = (int) VoxelBlockT<FieldType>::size_li;
int x_last = block_coord.x() + block_size;
int y_last = block_coord.y() + block_size;
int z_last = block_coord.z() + block_size;
for(z = block_coord.z(); z < z_last; ++z){
for (y = block_coord.y(); y < y_last; ++y){
for (x = block_coord.x(); x < x_last; ++x){
typename VoxelBlockT<FieldType>::VoxelData data;
const Eigen::Vector3i voxel_coord{x, y, z};
if(!geometry::aabb_aabb_collision(bbox_coord, size,
voxel_coord, Eigen::Vector3i::Constant(1))) continue;
data = block->data(Eigen::Vector3i(x, y, z));
status = update_status(status, test(data));
}
}
}
return status;
}
/*! \brief Perform a collision test between the input octree map and the
* input axis aligned bounding box bbox_coord of extension size. The test function
* test takes as input a voxel data and returns a collision_status. This is
* used to distinguish between seen-empty voxels and occupied voxels.
* \param octree octree map
* \param bbox_coord test bounding box lower bottom corner
* \param size extension in number of voxels of the bounding box
* \param test function that takes a voxel and returns a collision_status data
*/
template <typename FieldType, typename TestVoxelF>
collision_status collides_with(const Octree<FieldType>& octree,
const Eigen::Vector3i bbox_coord, const Eigen::Vector3i bbox_size, TestVoxelF test) {
typedef struct stack_entry {
se::Node<FieldType>* node_ptr;
Eigen::Vector3i coordinates;
int size;
typename se::Node<FieldType>::VoxelData parent_data;
} stack_entry;
stack_entry stack[Octree<FieldType>::max_voxel_depth * 8 + 1];
size_t stack_idx = 0;
se::Node<FieldType>* node = octree.root();
if(!node) return collision_status::unseen;
stack_entry current;
current.node_ptr = node;
current.size = octree.size();
current.coordinates = {0, 0, 0};
current.parent_data = FieldType::initData();
stack[stack_idx++] = current;
collision_status status = collision_status::empty;
while(stack_idx != 0){
node = current.node_ptr;
if(node->isBlock()){
status = collides_with(static_cast<VoxelBlockType<FieldType>*>(node),
bbox_coord, bbox_size, test);
}
if(node->children_mask() == 0) {
current = stack[--stack_idx];
continue;
}
for(int child_idx = 0; child_idx < 8; ++child_idx){
se::Node<FieldType>* child = node->child(child_idx);
stack_entry child_descr;
child_descr.node_ptr = nullptr;
child_descr.size = current.size / 2;
child_descr.coordinates =
Eigen::Vector3i(current.coordinates.x() + child_descr.size*((child_idx & 1) > 0),
current.coordinates.y() + child_descr.size*((child_idx & 2) > 0),
current.coordinates.z() + child_descr.size*((child_idx & 4) > 0));
const bool overlaps = geometry::aabb_aabb_collision(bbox_coord, bbox_size,
child_descr.coordinates, Eigen::Vector3i::Constant(child_descr.size));
if(overlaps && child != nullptr) {
child_descr.node_ptr = child;
child_descr.parent_data = node->childData(0);
stack[stack_idx++] = child_descr;
} else if(overlaps && child == nullptr) {
status = update_status(status, test(node->childData(0)));
}
}
current = stack[--stack_idx];
}
return status;
}
}
}
#endif
| cpp |
<reponame>dahan1999/search-engine
{"text":" How to find the slope of two line using slope formula\n\n[imath](4,3)(7,-2)[/imath]\n\n\n", "url":"https://www.youtube.com/watch?v=58l_HOzSy18"} | json |
A well balanced diet, exercising regularly and reducing your stress levels can go a long way in reducing the risk of PCOS.
Polycystic ovarian syndrome or PCOS is a condition that affects about 10% of women in India. Unhealthy eating habits, obesity and a stressful lifestyle are some of the major contributing factors to this condition.
PCOS is also associated with insulin resistance, fertility problems, and irregular periods as well as long-term health risks such as diabetes, heart ailments and hypertension.
However, you can prevent the risk of acquiring this condition by bringing some simple changes to your way of life.
It is important to eat a healthy and balanced diet. Plan your meals in advance so that you can incorporate all nutrient components into it.
“Including a variety of fruits and vegetables, low-fat dairy, oil-rich fish and lean meat is beneficial. Eat at regular intervals before you get too hungry to avoid overeating. Limit your intake of processed foods, and sugary and starchy items,” says Mumbai-based Dr Hrishikesh D Pai, medical director of Bloom IVF.
Physical activity not only helps you keep fit but is also an excellent way of reducing stress. Remember to include some moderately intense physical activity into your daily schedule to maintain a healthy weight.
This is one of the major risk factors for PCOS. Under stress, the body releases an excess of male hormones.
“High testosterone levels can lead to insulin resistance, eventually causing Type-2 diabetes. Therefore, stress management is essential for keeping PCOS under check. Get adequate sleep, and practice meditation and other relaxation techniques to bring down your stress levels,” explains Dr Pai.
Yoga coupled with various breathing techniques is a great way to deal with stress and put your body into detox mode.
“There are some specific yogasanas, which benefit the pelvic area by improving blood circulation and flexibility. Meditation and pranayama help in calming the mind by alleviating negativity and depression,” says Dr Nandita Palshetkar of the Federation of Obstetrics and Gynaecological Societies of India.
Even a little weight loss of about 0. 5–1 kg can help improve PCOS-related symptoms. It will help in regularising periods and improve your chances of conception. | english |
SILCHAR, Jan 28: BSF Frontier Mizoram and Cachar celebrated Republic Day with great pomp and show at its Masimpur campus. The tiol flag was hosted solemnly by D K Upadhyaya, Inspector General, in the presence of all ranks of BSF. In his speech, he congratulated all the border men and their families on the auspicious day and paid tributes to all the brave hearts who sacrificed their lives for the country. He also congratulated the medal winners on this occasion.
Sweets were distributed to the troops and their families. Following the tradition, the IG, along with all the senior officers took a round of the hospital and met the patients and wished them a very happy Republic Day and distributed sweets among them. In the forenoon, a party was organized at the officers’ institute in which subordite officers were invited and shared light moments where jazz band entertained the gathering with melodious songs and music. There was also exchange of sweets between BSF and Border Guards Bangladesh at the border as a goodwill gestures between the two border guarding forces. | english |
After Rama gives the necklace to Chikitha, she hands it over to Janaki. Then, Janaki reminds her that this necklace was the same she had bought for Urmila and feels happy that Rama has good taste. Chikitha then advises Rama to put the necklace around Jaanu himself. Rama tells Jaanu that he bought the necklace after listening to Janaki's words at the shop.
While Jnanamba attends the function along with the family. She then gives Janaki another neck chain saying she should look beautiful in front of the guests. And then, Jnanamba challenges Vyjayanthi that she will have grandchildren within a year.
Meanwhile, Sunanda Devi's son comes to the function and wishes Vyjayanthi. He feels annoyed after seeing Jnanamba and Janaki. What will Dheeraj plan to take revenge against Jnanamba is to be watched in the next episode. | english |
According to BBC, the series will examine how "Narendra Modi's premiership has been dogged by persistent allegations about the attitude of his government towards India's Muslim population".
New Delhi, Jan 19: India on Thursday said a recently broadcast BBC documentary on Prime Minister Narendra Modi, which questions his leadership during the 2002 Gujarat riots, was "propaganda".
"Do note that this has not been screened in India. . . We think that this is a propaganda piece, designed to push a particular discredited narrative. The bias, lack of objectivity and continuing colonial mindset is blatantly visible," MEA said on the BBC documentary on PM Modi.
"If anything, this film or documentary is a reflection on the agency & individuals that are peddling this narrative again. It makes us wonder about the purpose of this exercise &the agenda behind it. Frankly, we don't wish to dignify such efforts," he added.
With its bigoted agenda, the BBC, which has all along attempted to isolate hindus by selectively reporting crimes in which the alleged accused were reportedly Hindus and referred to it as a 'hate crime' has come up with a series that discusses PM Modi's role in 2002 Gujarat riots.
"A look at the tensions between Indian PM and India's Muslim minority, investigating claims about his role in 2002 riots that left over a thousand dead," says the description of the series.
This has angered Indians, who advised the BBC to run a series on the Bengal Famine called "UK: The Churchill Question".
"Is this another attempt to discredit India, and its Hindu people? ? All this documentary is going to do is cause more tension between the Hindus and Muslims in the UK," wrote a Twitter user.
"One thing Indians hate more than all their problems is being told by outsiders, specially past colonisers," another wrote.
"BBC is scared shit that at the rate India is progressing under Modi, someday an Indian conglomerate will take it over like NDTV. Get lost BBC! We don't need your education," another wrote along with #BanBBC in India.
The series will examine how "Narendra Modi's premiership has been dogged by persistent allegations about the attitude of his government towards India's Muslim population" and "a series of controversial policies" implemented by Modi following his 2019 re-election, including "the removal of Kashmir's special status guaranteed under Article 370" and "a citizenship law that many said treated Muslims unfairly", which "has been accompanied by reports of violent attacks on Muslims by Hindus," the BBC states.
The External Affairs Ministry spokesperson also noted that the documentary has not been screened in India.
Meanwhile, Prime Minister Rishi Sunak has come out in defence of Prime Minister Modi after the controversial BBC documentary claimed that the British government was aware about the Indian leader having an alleged role in the 2002 Gujarat riots.
Sunak said he does not agree with the characterisation of Prime Minister Modi by Pakistani-origin Imran Hussain, an Opposition Labour Party MP, when he asked if the British Premier agreed with claims in the BBC programme that some UK Foreign Office diplomats believed that "Modi was directly responsible". | english |
{ "idArt" : "501",
"series" : "Revue des Nouvelles Technologies de l'Information",
"booktitle" : "EGC",
"year" : "2009",
"place" : "Strasbourg",
"location" : { "lat" : 48.5734053,
"lon" : 7.752111299999999 },
"title" : "Analyse sémantique spatio-temporelle pour les ontologies OWL-DL",
"abstract" : "L'analyse sémantique est un nouveau paradigmed'interrogation du Web Sémantique qui a pour objectif d'identifier lesassociations sémantiques reliant des individus décrits dans desontologies OWL-DL. Pour déduire davantage d'associationssémantiques et augmenter la précision de l'analyse, l'informationspatio-temporelle attachée aux ressources doit être prise en compte. Aces fins - et pour combler l'absence actuelle de raisonneurs spatiotemporeldéfini pour les ontologies RDF(S) et OWL-, nous proposonsle système de représentation et d'interrogation d'ontologies spatiotemporellesONTOAST, compatible avec le langage OWL-DL. Nousprésentons les principes de base de l'algorithme de découverted'associations sémantiques entre individus intégré dans ONTOAST.Cet algorithme utilise deux contextes, l'un spatial et l'autre temporelqui permettent d'affiner la recherche. Nous décrivons enfin l'approchemise en oeuvre pour la déduction de connexions spatiales entreindividus.",
"authors" : ["<NAME>","<NAME>","<NAME>-Oliver"],
"pdf1page" : "http://editions-rnti.fr/render_pdf.php?p1&p=1000784" ,
"pdfarticle" : "http://editions-rnti.fr/render_pdf.php?p=1000784"
}
| json |
Fresh from their pitch at the TechCrunch Europe Geek ‘n Rolla event last week, UK social gambling startup Smarkets has completed a second round fund raising of £145k ($210k), exceeding the first round fund raising total of £100k in May 2008.
Despite what are clearly tough economic conditions, six private angel investors (details undisclosed) have participated this time and the funds will be used for the upcoming Smarkets launch.
In addition, Smarkets has completed its open RESTful API, in what appears to be a first for the betting industry. This is a betting exchange platform built with Erlang, a programming language enabling Smarkets to process thousands of bets per second.
Last week CEO and co-founder Jason Trost pitched Smarkets at Geek’n Rolla, a TechCrunch Europe for startups and investors. Here’s their pitch, recorded by Smarkets themselves:
| english |
The Delhi government has decided to be lenient towards those violating the ban on single-use plastic (SUP) items for the initial 10 days and has launched a massive campaign to create awareness against the use of such commodities and promote their alternatives.
It will also provide incentives to SUP manufacturing units willing to switch over to green alternatives.
Enforcing the ban without providing alternatives to people will be detrimental considering the effect of Covid on businesses and inflation, an official said.
Environment Minister Gopal Rai had Friday said the ban comes into effect when the unemployment rate is high.
"It is going to affect a large number of manufacturers, distributors and sellers of SUP items. Many people will find it difficult to make their ends meet. These people are our own," he had said.
A three-day fair is being organised at the Thyagraj Stadium here to promote alternatives to SUP items. On Sunday, the government will hold a roundtable conference with all the stakeholders, including food delivery services such as Zomato and Swiggy, to discuss these alternatives.
The government has also issued directions to urban local bodies to install kiosks in markets for promotion and sale of SUP alternatives. Delhi generates 1,060 tonnes of plastic waste per day. SUP is estimated to be 5.6 per cent (or 56 kg per metric tonnes) of the total solid waste in the capital.
The revenue department and the Delhi Pollution Control Committee have constituted 33 and 15 teams, respectively, to ensure enforcement of the ban.
The DPCC will ensure compliance with the ban in conforming areas, and MCD and other local bodies will be responsible for its implementation in the informal sector, officials said.
The MCD and other urban local bodies will act against the defaulting units according to their bylaws while the revenue department will take action under the Environment Protection Act.
Authorities will issue warning notices to units found violating the ban on 19 SUP items till July 10 and punitive action will be taken thereafter against repeat offenders.
The action will include a fine of up to ₹1 lakh or a jail term of up to five years or both under the Environment Protection Act, 1986.
The SUP items seized during the enforcement drive will be incinerated in waste-to-energy plants to ensure they do not end up in landfills or clog water bodies.
An official said the environment department will monitor the implementation of the ban through the "Green War Room", which was setup in October 2020 to keep a tab on air pollution levels and address related complaints.
The 'Green Delhi' mobile application has also been updated to receive complaints regarding violation of the ban on SUP items. Officials said meetings are being held with industrial associations to educate and guide them about the ban.
The government will continue to issue public notices in newspapers and social media.
Advisories have been issued for strict enforcement of the ban in public offices and letters sent to the directorate of education and the directorate of training and technical education for wider publicity among college and school students, they said.
The Confederation of All India Traders (CAIT) said it has asked traders across the country to follow the ban and has started a nationwide awareness drive which will continue till July 31.
CAIT Secretary General Praveen Khandelwal said traders will take out rallies in markets against the use of SUP items.
Ashish Jain, the founder of Indian Pollution Control Association, said the ban on SUP items is unlike the restrictions ordered on plastic items earlier.
"Governments failed to implement such restrictions in the past, and therefore, a large number of people did not take the ban on SUP items seriously. They hoped for a last-minute concession. That's why the Delhi government has decided to give them a grace period of 10 days," he said.
Besides the enforcement of the ban, the Delhi government has also decided to conduct a study to find out potential barriers in elimination of the SUP items.
The Delhi Pollution Control Committee has also asked Sriram Institute of Industrial Research to conduct a survey to identify littering hotspots and quantify plastic waste generation in the city.
On August 12 last year, the Union environment ministry had issued a notification prohibiting the manufacture, import, stocking, distribution, sale and use of identified SUP commodities, including polystyrene and expanded polystyrene, from July 1 this year.
The identified SUP items include earbuds, plastic sticks for balloons, flags, candy sticks, ice-cream sticks, polystyrene (thermocol), plates, cups, glasses, forks, spoons, knives, straws, trays, wrapping or packaging films around sweets boxes, invitation cards, cigarette packets, plastic or PVC banners of less than 100 microns and stirrers.
The thickness of plastic carry bags will have to be increased from 75 microns to 120 microns from December 31.
Plastic used for packaging in the FMCG sector is not banned but will be covered under the Extended Producer Responsibility (EPR) guidelines.
The EPR is a producer's responsibility to ensure environmentally-sound management of the product until the end of its life.
Unlock a world of Benefits! From insightful newsletters to real-time stock tracking, breaking news and a personalized newsfeed – it's all here, just a click away! Login Now!
| english |
<reponame>charles-halifax/recipes
{
"directions": [
"Cook and drain the penne pasta. Set aside.",
"In a pan or skillet, sweat thinly sliced onions, crushed garlic and bacon.",
"Add diced tomato and deglaze (cook until alcohol has evaporated) with vodka. Add crushed tomatoes and cream.",
"Reduce sauce until thickened and season with salt and pepper. Add to pasta, toss and serve. Bon appetite!"
],
"ingredients": [
"1 1/2 large yellow onions",
"5 cloves crushed garlic",
"10 slices bacon, diced",
"2 cups chopped tomatoes",
"1 (28 ounce) can crushed tomatoes",
"1 cup heavy whipping cream",
"2 fluid ounces vodka",
"12 ounces penne pasta"
],
"language": "en-US",
"source": "allrecipes.com",
"tags": [],
"title": "Penne a la Vodka I",
"url": "http://allrecipes.com/recipe/11856/penne-a-la-vodka-i/"
}
| json |
import React, {Component} from 'react';
import {list, textarea, element} from 'react-blessed';
export class MsgBox extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
if(this.props.readInput) {
this.refs.element.readInput(() => {
this.props.onSubmit(this.refs.element.value);
this.refs.element.clearValue();
});
}
}
componentWillReceiveProps(nextProps) {
if(nextProps.readInput) {
this.refs.element.readInput(() => {
this.props.onSubmit(this.refs.element.value);
this.refs.element.clearValue();
});
}
}
render() {
return (
<textarea
ref="element"
width="80%"
height="10%"
top="90%"
left="20%"
border={{type: 'line'}}
style={{border: {fg: 'green'}}} />
);
}
}
| javascript |
import { Component, OnInit, Input } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { FormBuilder, FormGroup } from '@angular/forms';
import { UserDataService } from 'src/app/admin_modules/admin_dashboard/services/user-data.service';
@Component({
selector: 'app-create-or-update-api-audit-properties',
templateUrl: './create-or-update-api-audit-properties.component.html',
styleUrls: ['./create-or-update-api-audit-properties.component.scss']
})
export class CreateOrUpdateApiAuditPropertiesComponent implements OnInit {
@Input() public name: string;
@Input() public properties: {};
propertiesJSON = '';
apiAuditPropertiesForm: FormGroup;
id: string;
disableName = false;
constructor(
public activeModal: NgbActiveModal,
private formBuilder: FormBuilder,
private userData: UserDataService
) {
this.createForm();
}
ngOnInit() {
setTimeout(() => {
this.apiAuditPropertiesForm.get('name').setValue(this.name);
this.apiAuditPropertiesForm.get('properties').setValue(this.properties);
this.propertiesJSON = JSON.stringify(this.properties);
if (this.name) {
this.disableName = true;
}
});
}
private createForm() {
this.apiAuditPropertiesForm = this.formBuilder.group({
name: '',
properties: ''
});
}
submit() {
let collector = {};
if (this.id) {
// Edit
try {
collector = {
id: this.id,
name: this.apiAuditPropertiesForm.get('name').value,
collectorType: 'ApiAudit',
properties: JSON.parse(this.apiAuditPropertiesForm.get('properties').value),
};
} catch (e) {
}
} else {
// Post
try {
collector = {
name: this.apiAuditPropertiesForm.get('name').value,
collectorType: 'ApiAudit',
properties: JSON.parse(this.apiAuditPropertiesForm.get('properties').value),
};
} catch (e) {
}
}
this.userData
.createOrUpdatePropertiesBuilder(collector)
.subscribe( (response) => {
this.activeModal.close('close');
}, (error) => {
console.log(error);
});
}
}
| typescript |
<reponame>Xxpussy-Slayer69xX/SaF2021
{"parent": "spartanweaponry:item/glaive_wood", "textures": {"layer0": "saf2021:items/glaive_dragon"}} | json |
<gh_stars>0
import React, { FC, useState, KeyboardEvent } from 'react';
import { makeStyles, createStyles, Dialog, DialogContent } from '@material-ui/core';
const useStyles = makeStyles(() =>
createStyles({
screenshot: {
margin: '20px 0 0 24px',
border: '1px solid rgba(0, 0, 0, 0.23)',
height: '50%',
width: '50%',
},
})
);
interface Props {
screenshotPath: string;
}
const StepScreenshot: FC<Props> = ({ screenshotPath }) => {
const [enhanceScreenShot, setEnhanceScreenshot] = useState(false);
const classes = useStyles();
const url = `${process.env.REACT_APP_BACKEND_HOST}/rest/attachment/${screenshotPath}`;
return (
<>
<span
onClick={(): void => setEnhanceScreenshot(true)}
onKeyPress={(e: KeyboardEvent<HTMLElement>): void => {
if (e.key === 'Enter') {
setEnhanceScreenshot(true);
}
}}
>
<img src={url} alt="" className={classes.screenshot} />
</span>
<Dialog
open={enhanceScreenShot}
onClose={(): void => setEnhanceScreenshot(false)}
onEscapeKeyDown={(): void => setEnhanceScreenshot(false)}
onBackdropClick={(): void => setEnhanceScreenshot(false)}
maxWidth={false}
>
<DialogContent>{<img src={url} alt="" style={{ height: '100%', width: '100%' }} />}</DialogContent>
</Dialog>
</>
);
};
export default StepScreenshot;
| typescript |
# @react-md/icon
Create icons using a font-icon library like material-icons or font-awesome or
plain old accessible SVG icons. There are also a few additional helpers to
creating animating rotating icons and separating text from an icon.
## Installation
```sh
$ npm install --save @react-md/icon
```
It is also recommended to install the other packages if you have not done so:
```sh
$ npm install --save @react-md/theme @react-md/typography
```
## Pre-made material icons
If you would like to have access to all material icons as existing components
instead of having to manually remember the correct `children` to provide or the
correct `path`, you can install the `@react-md/material-icons` package. This
will include **all** material icons as font and SVGs.
<!-- DOCS_REMOVE -->
## Documentation
You should check out the
[full documentation](https://react-md.dev/packages/icon) for live examples and
more customization information, but an example usage is shown below.
<!-- DOCS_REMOVE_END -->
## Usage
Even though the `FontIcon` and `SVGIcon` components are the "main" exports for
this package, they are more utility components and probably won't be used much
once you set up your own icon system. The _real_ exports are going to be the
`TextIconSpacing` and `IconRotator` components.
The `TextIconSpacing` component is used to add spacing between an icon and some
"text" where the text can be any renderable element. The `IconRotator` is used
to animate an icon rotation such as expander or collapse icons.
```tsx
import React, { Fragment } from "react";
import { render } from "react-dom";
import { FontIcon, TextIconSpacing } from "@react-md/icon";
import { Text } from "@react-md/typography";
// the Text component is optional, it'll just add better typography
// than normal text.
const App = () => (
<Fragment>
// creates an icon spaced before the "Go Home" text
<TextIconSpacing icon={<FontIcon>home</FontIcon>}>
<Text>Go Home</Text>
</TextIconSpacing>
// creates an icon spaced after the "Go Home" text
<TextIconSpacing icon={<FontIcon>home</FontIcon>} iconAfter>
<Text>Go Home</Text>
</TextIconSpacing>
// it can also be combined
<TextIconSpacing icon={<FontIcon>arrow_back</FontIcon>}>
<TextIconSpacing icon={<FontIcon>home</FontIcon>} iconAfter>
<Text>Go Home</Text>
</TextIconSpacing>
</TextIconSpacing>
</Fragment>
);
render(<App />, document.getElementById("root"));
```
This package's icon component usage is really only helpful when generating icon
components through an external script or using font icons. However, here are a
few examples of using the `FontIcon` and `SVGIcon` components:
```tsx
import React, { Fragment } from "react";
import { render } from "react-dom";
import { FontIcon, SVGIcon } from "@react-md/icon";
// When using font icons, you'll need to make sure they icon fonts have been
// correctly included in your app. Check out the documentation site for more
// info
const App = () => (
<Fragment>
<FontIcon>home</FontIcon>
<FontIcon iconClassName="fa fa-github" aria-label="Github" />
<SVGIcon title="Face">
<path d="M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8z" />
</SVGIcon>
</Fragment>
);
render(<App />, document.getElementById("root"));
```
| markdown |
<gh_stars>1-10
package model
type (
// Patterns represents a list of patterns.
// A pattern is an expression specified as string which can be used to select a subset of files.
Patterns []string
)
| go |
/*
* This file was automatically generated by EvoSuite
* Thu Apr 19 10:27:57 GMT 2018
*/
package org.jsoup.parser;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.jsoup.parser.TokenQueue;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class TokenQueue_ESTest extends TokenQueue_ESTest_scaffolding {
@Test(timeout = 4000)
public void test00() throws Throwable {
String string0 = TokenQueue.unescape("e{N5c&]pz");
assertNotNull(string0);
assertEquals("e{N5c&]pz", string0);
}
@Test(timeout = 4000)
public void test01() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("yij\"co");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertEquals('y', tokenQueue0.peek());
assertEquals("yij\"co", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
String string0 = tokenQueue0.consumeCssIdentifier();
assertNotNull(string0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals('\"', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("\"co", tokenQueue0.toString());
assertEquals("yij", string0);
String string1 = tokenQueue0.chompBalanced('\u0018', '3');
assertNotNull(string1);
assertFalse(string1.equals((Object)string0));
assertFalse(tokenQueue0.isEmpty());
assertEquals('c', tokenQueue0.peek());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("co", tokenQueue0.toString());
assertEquals("", string1);
}
@Test(timeout = 4000)
public void test02() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("'");
assertNotNull(tokenQueue0);
assertEquals('\'', tokenQueue0.peek());
assertEquals("'", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
String string0 = tokenQueue0.chompBalanced('(', '.');
assertNotNull(string0);
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test03() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("!_=@<m07yi v/7");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.isEmpty());
assertEquals("!_=@<m07yi v/7", tokenQueue0.toString());
assertEquals('!', tokenQueue0.peek());
tokenQueue0.addFirst("!_=@<m07yi v/7");
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.isEmpty());
assertEquals("!_=@<m07yi v/7!_=@<m07yi v/7", tokenQueue0.toString());
assertEquals('!', tokenQueue0.peek());
tokenQueue0.advance();
assertFalse(tokenQueue0.matchesWord());
assertEquals('_', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.isEmpty());
assertEquals("_=@<m07yi v/7!_=@<m07yi v/7", tokenQueue0.toString());
String string0 = tokenQueue0.chompTo("!_=@<m07yi v/7");
assertNotNull(string0);
assertFalse(tokenQueue0.matchesWord());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
assertEquals("", tokenQueue0.toString());
assertEquals("_=@<m07yi v/7", string0);
}
@Test(timeout = 4000)
public void test04() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("0k>j%'?n[uHF(.|7");
assertNotNull(tokenQueue0);
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals("0k>j%'?n[uHF(.|7", tokenQueue0.toString());
assertEquals('0', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
tokenQueue0.consume("0k>j%'?n[uHF(.|7");
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
}
@Test(timeout = 4000)
public void test05() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("!_=@<m07yi v/7");
assertNotNull(tokenQueue0);
assertEquals('!', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertEquals("!_=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
String string0 = tokenQueue0.chompTo("!_=@<m07yi v/7");
assertNotNull(string0);
assertEquals('\u0000', tokenQueue0.peek());
assertTrue(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", string0);
tokenQueue0.consume("");
assertEquals('\u0000', tokenQueue0.peek());
assertTrue(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
}
@Test(timeout = 4000)
public void test06() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("2Sy>O");
assertNotNull(tokenQueue0);
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals('2', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("2Sy>O", tokenQueue0.toString());
String string0 = tokenQueue0.consumeTagName();
assertNotNull(string0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals(">O", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('>', tokenQueue0.peek());
assertEquals("2Sy", string0);
boolean boolean0 = tokenQueue0.matchesStartTag();
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals(">O", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('>', tokenQueue0.peek());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test07() throws Throwable {
String string0 = TokenQueue.unescape("");
assertNotNull(string0);
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test08() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("S");
assertNotNull(tokenQueue0);
assertEquals("S", tokenQueue0.toString());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.isEmpty());
assertEquals('S', tokenQueue0.peek());
tokenQueue0.advance();
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
String string0 = tokenQueue0.toString();
assertNotNull(string0);
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test09() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(" ");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals(' ', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals(" ", tokenQueue0.toString());
String string0 = tokenQueue0.chompTo(" ");
assertNotNull(string0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertEquals('\u0000', tokenQueue0.peek());
assertTrue(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", string0);
String string1 = tokenQueue0.remainder();
assertNotNull(string1);
assertTrue(string1.equals((Object)string0));
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertEquals('\u0000', tokenQueue0.peek());
assertTrue(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", string1);
}
@Test(timeout = 4000)
public void test10() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("96O48J&NTnb");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("96O48J&NTnb", tokenQueue0.toString());
assertTrue(tokenQueue0.matchesWord());
assertEquals('9', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
char char0 = tokenQueue0.peek();
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("96O48J&NTnb", tokenQueue0.toString());
assertTrue(tokenQueue0.matchesWord());
assertEquals('9', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertEquals('9', char0);
}
@Test(timeout = 4000)
public void test11() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
boolean boolean0 = tokenQueue0.matchesCS("");
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test12() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
boolean boolean0 = tokenQueue0.matchesCS("org.jsoup.parser.TokenQueue");
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test13() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
boolean boolean0 = tokenQueue0.matches("?*B&*_K:j");
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test14() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("Did not find balanced marker at '");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertEquals('D', tokenQueue0.peek());
assertEquals("Did not find balanced marker at '", tokenQueue0.toString());
char char0 = tokenQueue0.consume();
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertEquals("id not find balanced marker at '", tokenQueue0.toString());
assertEquals('i', tokenQueue0.peek());
assertEquals('D', char0);
}
@Test(timeout = 4000)
public void test15() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("!_=@<m07yi v/7");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesWord());
assertEquals('!', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("!_=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
tokenQueue0.advance();
assertFalse(tokenQueue0.matchesWord());
assertEquals('_', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("_=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
String string0 = tokenQueue0.chompTo("!_=@<m07yi v/7");
assertNotNull(string0);
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertEquals("", tokenQueue0.toString());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("_=@<m07yi v/7", string0);
}
@Test(timeout = 4000)
public void test16() throws Throwable {
// Undeclared exception!
try {
TokenQueue.unescape((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test17() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("[Nx!)nM");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("[Nx!)nM", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertEquals('[', tokenQueue0.peek());
String[] stringArray0 = new String[9];
// Undeclared exception!
try {
tokenQueue0.matchesAny(stringArray0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test18() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("ek`kQOEUce.~{U");
assertNotNull(tokenQueue0);
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('e', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertEquals("ek`kQOEUce.~{U", tokenQueue0.toString());
// Undeclared exception!
try {
tokenQueue0.matchesAny((char[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test19() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
// Undeclared exception!
try {
tokenQueue0.matches((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test20() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
// Undeclared exception!
try {
tokenQueue0.matchChomp((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test21() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
// Undeclared exception!
try {
tokenQueue0.consumeToIgnoreCase("");
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test22() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("Did not find balanced marker at '");
assertNotNull(tokenQueue0);
assertEquals('D', tokenQueue0.peek());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals("Did not find balanced marker at '", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
// Undeclared exception!
try {
tokenQueue0.consumeToIgnoreCase((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test23() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("Y0(?Q>p!,;3");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("Y0(?Q>p!,;3", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertEquals('Y', tokenQueue0.peek());
// Undeclared exception!
try {
tokenQueue0.consumeToAny((String[]) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test24() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("w");
assertNotNull(tokenQueue0);
assertEquals('w', tokenQueue0.peek());
assertEquals("w", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
// Undeclared exception!
try {
tokenQueue0.consumeTo((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test25() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("oig)dO r0aZ!ll^qk");
assertNotNull(tokenQueue0);
assertEquals("oig)dO r0aZ!ll^qk", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertEquals('o', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
// Undeclared exception!
try {
tokenQueue0.consume((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test26() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(" ");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.isEmpty());
assertEquals(" ", tokenQueue0.toString());
assertEquals(' ', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
String string0 = tokenQueue0.chompTo(" ");
assertNotNull(string0);
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", string0);
// Undeclared exception!
try {
tokenQueue0.consume();
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test27() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("\"^\"/[544hz7sJ5m$N3#");
assertNotNull(tokenQueue0);
assertEquals('\"', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals("\"^\"/[544hz7sJ5m$N3#", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
// Undeclared exception!
try {
tokenQueue0.chompToIgnoreCase("");
fail("Expecting exception: StringIndexOutOfBoundsException");
} catch(StringIndexOutOfBoundsException e) {
}
}
@Test(timeout = 4000)
public void test28() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(" ");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals(' ', tokenQueue0.peek());
assertEquals(" ", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
// Undeclared exception!
try {
tokenQueue0.chompToIgnoreCase((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test29() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("H`WChzSEv_:J");
assertNotNull(tokenQueue0);
assertEquals("H`WChzSEv_:J", tokenQueue0.toString());
assertEquals('H', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
// Undeclared exception!
try {
tokenQueue0.chompTo((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test30() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("[s'xP 'LT_~?}7");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesWord());
assertEquals("[s'xP 'LT_~?}7", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('[', tokenQueue0.peek());
// Undeclared exception!
try {
tokenQueue0.addFirst((Character) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test31() throws Throwable {
TokenQueue tokenQueue0 = null;
try {
tokenQueue0 = new TokenQueue((String) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Object must not be null
//
verifyException("org.jsoup.helper.Validate", e);
}
}
@Test(timeout = 4000)
public void test32() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("h!dI|VJ0F");
assertNotNull(tokenQueue0);
assertEquals("h!dI|VJ0F", tokenQueue0.toString());
assertEquals('h', tokenQueue0.peek());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
String string0 = tokenQueue0.consumeToIgnoreCase("U;'>9qUV|hA_> `Q8");
assertNotNull(string0);
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("h!dI|VJ0F", string0);
}
@Test(timeout = 4000)
public void test33() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("..|SmV5,gWZh");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('.', tokenQueue0.peek());
assertEquals("..|SmV5,gWZh", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
String string0 = tokenQueue0.consumeToIgnoreCase("..|SmV5,gWZh");
assertNotNull(string0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('.', tokenQueue0.peek());
assertEquals("..|SmV5,gWZh", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test34() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(" ");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals(" ", tokenQueue0.toString());
assertEquals(' ', tokenQueue0.peek());
String string0 = tokenQueue0.consumeTo(" ");
assertNotNull(string0);
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals(" ", tokenQueue0.toString());
assertEquals(' ', tokenQueue0.peek());
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test35() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("'{N");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals("'{N", tokenQueue0.toString());
assertEquals('\'', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
boolean boolean0 = tokenQueue0.matchesWord();
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals("'{N", tokenQueue0.toString());
assertEquals('\'', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test36() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
boolean boolean0 = tokenQueue0.matchesWord();
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test37() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("099+q?kDnl\"`qt");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertEquals('0', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("099+q?kDnl\"`qt", tokenQueue0.toString());
boolean boolean0 = tokenQueue0.matchesWord();
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertEquals('0', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("099+q?kDnl\"`qt", tokenQueue0.toString());
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test38() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(" ");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesWord());
assertEquals(" ", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals(' ', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
boolean boolean0 = tokenQueue0.matchesWhitespace();
assertFalse(tokenQueue0.matchesWord());
assertEquals(" ", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals(' ', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test39() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("oig)dO r0aZ!ll^qk");
assertNotNull(tokenQueue0);
assertEquals('o', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("oig)dO r0aZ!ll^qk", tokenQueue0.toString());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
boolean boolean0 = tokenQueue0.matchesWhitespace();
assertEquals('o', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("oig)dO r0aZ!ll^qk", tokenQueue0.toString());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test40() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(" ");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.isEmpty());
assertEquals(" ", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertEquals(' ', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
String string0 = tokenQueue0.chompTo(" ");
assertNotNull(string0);
assertFalse(tokenQueue0.matchesWord());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
assertEquals("", string0);
boolean boolean0 = tokenQueue0.matchesWhitespace();
assertFalse(tokenQueue0.matchesWord());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test41() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("';(ZO2<m_nxZ^CfgEm");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertEquals('\'', tokenQueue0.peek());
assertEquals("';(ZO2<m_nxZ^CfgEm", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
boolean boolean0 = tokenQueue0.matchChomp("Queue not long enough to consume sequence");
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertEquals('\'', tokenQueue0.peek());
assertEquals("';(ZO2<m_nxZ^CfgEm", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test42() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
boolean boolean0 = tokenQueue0.matchChomp("");
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test43() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("-'<-go&");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('-', tokenQueue0.peek());
assertEquals("-'<-go&", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
char[] charArray0 = new char[1];
boolean boolean0 = tokenQueue0.matchesAny(charArray0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('-', tokenQueue0.peek());
assertEquals("-'<-go&", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals(1, charArray0.length);
assertArrayEquals(new char[] {'\u0000'}, charArray0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test44() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
char[] charArray0 = new char[8];
tokenQueue0.addFirst((Character) '\u0000');
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("\u0000", tokenQueue0.toString());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
boolean boolean0 = tokenQueue0.matchesAny(charArray0);
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("\u0000", tokenQueue0.toString());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals(8, charArray0.length);
assertArrayEquals(new char[] {'\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000', '\u0000'}, charArray0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test45() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("-'<-go&");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("-'<-go&", tokenQueue0.toString());
assertEquals('-', tokenQueue0.peek());
String[] stringArray0 = new String[3];
stringArray0[0] = "";
boolean boolean0 = tokenQueue0.matchesAny(stringArray0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("-'<-go&", tokenQueue0.toString());
assertEquals('-', tokenQueue0.peek());
assertEquals(3, stringArray0.length);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test46() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
String[] stringArray0 = new String[1];
stringArray0[0] = "ZLk()5,VMa|)T6";
boolean boolean0 = tokenQueue0.matchesAny(stringArray0);
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
assertEquals(1, stringArray0.length);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test47() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
assertNotNull(tokenQueue0);
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
boolean boolean0 = tokenQueue0.isEmpty();
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test48() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(" ");
assertNotNull(tokenQueue0);
assertEquals(" ", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertEquals(' ', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
boolean boolean0 = tokenQueue0.isEmpty();
assertEquals(" ", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertEquals(' ', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test49() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("ek`kQOEUce.~{U");
assertNotNull(tokenQueue0);
assertEquals("ek`kQOEUce.~{U", tokenQueue0.toString());
assertEquals('e', tokenQueue0.peek());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
boolean boolean0 = tokenQueue0.matches("");
assertEquals("ek`kQOEUce.~{U", tokenQueue0.toString());
assertEquals('e', tokenQueue0.peek());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test50() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("N(g]j4DjoAuaz6R2G");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('N', tokenQueue0.peek());
assertEquals("N(g]j4DjoAuaz6R2G", tokenQueue0.toString());
Character character0 = new Character('1');
assertNotNull(character0);
assertEquals('1', (char)character0);
String string0 = tokenQueue0.consumeWord();
assertNotNull(string0);
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("(g]j4DjoAuaz6R2G", tokenQueue0.toString());
assertEquals('(', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("N", string0);
tokenQueue0.addFirst(character0);
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertEquals('1', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("1(g]j4DjoAuaz6R2G", tokenQueue0.toString());
char char0 = tokenQueue0.consume();
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("(g]j4DjoAuaz6R2G", tokenQueue0.toString());
assertEquals('(', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals('1', char0);
String string1 = tokenQueue0.chompBalanced('.', '1');
assertNotNull(string1);
assertFalse(string1.equals((Object)string0));
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertEquals("g]j4DjoAuaz6R2G", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('g', tokenQueue0.peek());
assertEquals("", string1);
String string2 = tokenQueue0.consumeAttributeKey();
assertNotNull(string2);
assertFalse(string2.equals((Object)string0));
assertFalse(string2.equals((Object)string1));
assertFalse(tokenQueue0.isEmpty());
assertEquals("]j4DjoAuaz6R2G", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals(']', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("g", string2);
}
@Test(timeout = 4000)
public void test51() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("hL1R5=ze");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('h', tokenQueue0.peek());
assertTrue(tokenQueue0.matchesWord());
assertEquals("hL1R5=ze", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
String string0 = tokenQueue0.consumeTo("org.jsoup.helper.StringUtil$1");
assertNotNull(string0);
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("hL1R5=ze", string0);
String string1 = tokenQueue0.consumeAttributeKey();
assertNotNull(string1);
assertFalse(string1.equals((Object)string0));
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", string1);
}
@Test(timeout = 4000)
public void test52() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("-");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("-", tokenQueue0.toString());
assertEquals('-', tokenQueue0.peek());
String string0 = tokenQueue0.consumeCssIdentifier();
assertNotNull(string0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("-", string0);
}
@Test(timeout = 4000)
public void test53() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("_");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.isEmpty());
assertEquals("_", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('_', tokenQueue0.peek());
String string0 = tokenQueue0.consumeElementSelector();
assertNotNull(string0);
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
assertEquals("_", string0);
}
@Test(timeout = 4000)
public void test54() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("i*NHG~bx$KN9x92CT");
assertNotNull(tokenQueue0);
assertEquals("i*NHG~bx$KN9x92CT", tokenQueue0.toString());
assertTrue(tokenQueue0.matchesWord());
assertEquals('i', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
String string0 = tokenQueue0.chompToIgnoreCase("i*NHG~bx$KN9x92CT");
assertNotNull(string0);
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertEquals("", string0);
String string1 = tokenQueue0.consumeElementSelector();
assertNotNull(string1);
assertTrue(string1.equals((Object)string0));
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertEquals("", string1);
}
@Test(timeout = 4000)
public void test55() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("hL1R5=ze");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('h', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertEquals("hL1R5=ze", tokenQueue0.toString());
assertTrue(tokenQueue0.matchesWord());
String string0 = tokenQueue0.consumeTo("org.jsoup.helper.StringUtil$1");
assertNotNull(string0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertEquals("hL1R5=ze", string0);
String string1 = tokenQueue0.consumeTagName();
assertNotNull(string1);
assertFalse(string1.equals((Object)string0));
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertEquals("", string1);
}
@Test(timeout = 4000)
public void test56() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("-'<-go&");
assertNotNull(tokenQueue0);
assertEquals("-'<-go&", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('-', tokenQueue0.peek());
String string0 = tokenQueue0.consumeAttributeKey();
assertNotNull(string0);
assertEquals('\'', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals("'<-go&", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("-", string0);
String string1 = tokenQueue0.chompBalanced('!', 'p');
assertNotNull(string1);
assertFalse(string1.equals((Object)string0));
assertEquals("<-go&", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('<', tokenQueue0.peek());
assertEquals("", string1);
String string2 = tokenQueue0.chompBalanced('p', 'h');
assertNotNull(string2);
assertFalse(string2.equals((Object)string0));
assertEquals("-go&", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('-', tokenQueue0.peek());
assertEquals("", string2);
String string3 = tokenQueue0.chompBalanced('!', '!');
assertNotNull(string3);
assertFalse(string3.equals((Object)string0));
assertTrue(tokenQueue0.matchesWord());
assertEquals("go&", tokenQueue0.toString());
assertEquals('g', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", string3);
String string4 = tokenQueue0.consumeWord();
assertNotNull(string4);
assertFalse(string4.equals((Object)string1));
assertFalse(string4.equals((Object)string3));
assertFalse(string4.equals((Object)string2));
assertFalse(string4.equals((Object)string0));
assertEquals('&', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals("&", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("go", string4);
}
@Test(timeout = 4000)
public void test57() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("%X");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertEquals('%', tokenQueue0.peek());
assertEquals("%X", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
Character character0 = Character.valueOf('J');
assertNotNull(character0);
assertEquals('J', (char)character0);
tokenQueue0.addFirst(character0);
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("J%X", tokenQueue0.toString());
assertEquals('J', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
String string0 = tokenQueue0.chompBalanced('n', 'J');
assertNotNull(string0);
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertEquals('%', tokenQueue0.peek());
assertEquals("%X", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test58() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("yij\"co");
assertNotNull(tokenQueue0);
assertTrue(tokenQueue0.matchesWord());
assertEquals('y', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertEquals("yij\"co", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
Character character0 = new Character('\"');
assertNotNull(character0);
assertEquals('\"', (char)character0);
tokenQueue0.addFirst(character0);
assertEquals("\"yij\"co", tokenQueue0.toString());
assertEquals('\"', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
// Undeclared exception!
try {
tokenQueue0.chompBalanced('\"', '3');
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Did not find balanced marker at 'yij\"co'
//
verifyException("org.jsoup.helper.Validate", e);
}
}
@Test(timeout = 4000)
public void test59() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("yij\"co");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals("yij\"co", tokenQueue0.toString());
assertEquals('y', tokenQueue0.peek());
String string0 = tokenQueue0.consumeCssIdentifier();
assertNotNull(string0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("\"co", tokenQueue0.toString());
assertEquals('\"', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertEquals("yij", string0);
String string1 = tokenQueue0.chompBalanced('4', '4');
assertNotNull(string1);
assertFalse(string1.equals((Object)string0));
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.matchesWord());
assertEquals('c', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertEquals("co", tokenQueue0.toString());
assertEquals("", string1);
}
@Test(timeout = 4000)
public void test60() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("!_=@<m07yi v/7");
assertNotNull(tokenQueue0);
assertEquals("!_=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.isEmpty());
assertEquals('!', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
tokenQueue0.advance();
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.isEmpty());
assertEquals('_', tokenQueue0.peek());
assertEquals("_=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
String string0 = tokenQueue0.consumeTagName();
assertNotNull(string0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('=', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertEquals("=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertEquals("_", string0);
// Undeclared exception!
try {
tokenQueue0.chompBalanced('=', '=');
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Did not find balanced marker at '@<m07yi v/7'
//
verifyException("org.jsoup.helper.Validate", e);
}
}
@Test(timeout = 4000)
public void test61() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("jceU87yYw+0 m>^@");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertEquals("jceU87yYw+0 m>^@", tokenQueue0.toString());
assertEquals('j', tokenQueue0.peek());
String string0 = tokenQueue0.consumeToIgnoreCase("8|bxFQmA,");
assertNotNull(string0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("", tokenQueue0.toString());
assertTrue(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals("jceU87yYw+0 m>^@", string0);
}
@Test(timeout = 4000)
public void test62() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("i*NHG~bx$KN9x92CT");
assertNotNull(tokenQueue0);
assertEquals('i', tokenQueue0.peek());
assertEquals("i*NHG~bx$KN9x92CT", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertTrue(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
String string0 = tokenQueue0.consumeCssIdentifier();
assertNotNull(string0);
assertEquals('*', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("*NHG~bx$KN9x92CT", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("i", string0);
String string1 = tokenQueue0.chompToIgnoreCase("i*NHG~bx$KN9x92CT");
assertNotNull(string1);
assertFalse(string1.equals((Object)string0));
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('\u0000', tokenQueue0.peek());
assertEquals("*NHG~bx$KN9x92CT", string1);
}
@Test(timeout = 4000)
public void test63() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("_");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("_", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertEquals('_', tokenQueue0.peek());
String[] stringArray0 = new String[0];
String string0 = tokenQueue0.consumeToAny(stringArray0);
assertNotNull(string0);
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertEquals(0, stringArray0.length);
assertEquals("_", string0);
// Undeclared exception!
try {
tokenQueue0.consume("_");
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// Queue did not match expected sequence
//
verifyException("org.jsoup.parser.TokenQueue", e);
}
}
@Test(timeout = 4000)
public void test64() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("!_=@<m07yi v/7");
assertNotNull(tokenQueue0);
assertEquals('!', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals("!_=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
tokenQueue0.consume("");
assertEquals('!', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals("!_=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
}
@Test(timeout = 4000)
public void test65() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(".'<qgo&");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('.', tokenQueue0.peek());
assertEquals(".'<qgo&", tokenQueue0.toString());
String string0 = tokenQueue0.chompToIgnoreCase("-");
assertNotNull(string0);
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals(".'<qgo&", string0);
tokenQueue0.advance();
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
}
@Test(timeout = 4000)
public void test66() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("hL1R5=ze");
assertNotNull(tokenQueue0);
assertEquals("hL1R5=ze", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.matchesWord());
assertEquals('h', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
String string0 = tokenQueue0.consumeTo("org.jsoup.helper.StringUtil$1");
assertNotNull(string0);
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertEquals("hL1R5=ze", string0);
String string1 = tokenQueue0.consumeWord();
assertNotNull(string1);
assertFalse(string1.equals((Object)string0));
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertEquals("", string1);
}
@Test(timeout = 4000)
public void test67() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(" ");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.isEmpty());
assertEquals(' ', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals(" ", tokenQueue0.toString());
boolean boolean0 = tokenQueue0.consumeWhitespace();
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertTrue(tokenQueue0.isEmpty());
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test68() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("!_=@<m07yi v/7");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("!_=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals('!', tokenQueue0.peek());
boolean boolean0 = tokenQueue0.consumeWhitespace();
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("!_=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertEquals('!', tokenQueue0.peek());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test69() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("!_=@<m07yi v/7");
assertNotNull(tokenQueue0);
assertEquals("!_=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals('!', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
tokenQueue0.advance();
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertEquals('_', tokenQueue0.peek());
assertEquals("_=@<m07yi v/7", tokenQueue0.toString());
String string0 = tokenQueue0.consumeTagName();
assertNotNull(string0);
assertEquals("=@<m07yi v/7", tokenQueue0.toString());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertFalse(tokenQueue0.matchesWord());
assertEquals('=', tokenQueue0.peek());
assertEquals("_", string0);
char char0 = tokenQueue0.consume();
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("@<m07yi v/7", tokenQueue0.toString());
assertEquals('@', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesWord());
assertEquals('=', char0);
tokenQueue0.advance();
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals("<m07yi v/7", tokenQueue0.toString());
assertEquals('<', tokenQueue0.peek());
assertTrue(tokenQueue0.matchesStartTag());
boolean boolean0 = tokenQueue0.matchesStartTag();
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesWord());
assertEquals("<m07yi v/7", tokenQueue0.toString());
assertEquals('<', tokenQueue0.peek());
assertTrue(tokenQueue0.matchesStartTag());
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test70() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("-'<-go&");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("-'<-go&", tokenQueue0.toString());
assertEquals('-', tokenQueue0.peek());
boolean boolean0 = tokenQueue0.matchesStartTag();
assertFalse(tokenQueue0.matchesWord());
assertFalse(tokenQueue0.isEmpty());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("-'<-go&", tokenQueue0.toString());
assertEquals('-', tokenQueue0.peek());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test71() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("i*NHG~bx$KN9x92CT");
assertNotNull(tokenQueue0);
assertFalse(tokenQueue0.matchesStartTag());
assertTrue(tokenQueue0.matchesWord());
assertEquals('i', tokenQueue0.peek());
assertFalse(tokenQueue0.isEmpty());
assertEquals("i*NHG~bx$KN9x92CT", tokenQueue0.toString());
String string0 = tokenQueue0.chompToIgnoreCase("i*NHG~bx$KN9x92CT");
assertNotNull(string0);
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertEquals("", string0);
boolean boolean0 = tokenQueue0.matchesStartTag();
assertTrue(tokenQueue0.isEmpty());
assertEquals('\u0000', tokenQueue0.peek());
assertFalse(tokenQueue0.matchesStartTag());
assertEquals("", tokenQueue0.toString());
assertFalse(tokenQueue0.matchesWord());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test72() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("-'<-go&");
tokenQueue0.consumeAttributeKey();
tokenQueue0.chompBalanced('!', 'p');
boolean boolean0 = tokenQueue0.matchesStartTag();
assertEquals('<', tokenQueue0.peek());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test73() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("..|SmV5,gWZh");
tokenQueue0.consumeTo("Z)yEn5rzI]4C[G`&");
char[] charArray0 = new char[6];
boolean boolean0 = tokenQueue0.matchesAny(charArray0);
assertEquals("", tokenQueue0.toString());
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test74() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("\"^\"/[544hz7sJ5m$N3#");
String[] stringArray0 = new String[5];
stringArray0[0] = "\"^\"/[544hz7sJ5m$N3#";
String string0 = tokenQueue0.consumeToAny(stringArray0);
assertEquals('\"', tokenQueue0.peek());
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test75() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(".'<qgo&");
tokenQueue0.consumeElementSelector();
assertEquals('.', tokenQueue0.peek());
}
@Test(timeout = 4000)
public void test76() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue(".'<qgo&");
tokenQueue0.chompToIgnoreCase("-");
char char0 = tokenQueue0.peek();
assertEquals("", tokenQueue0.toString());
assertEquals('\u0000', char0);
}
@Test(timeout = 4000)
public void test77() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("Did not find balanced marker at '");
char char0 = tokenQueue0.peek();
assertEquals('D', char0);
}
@Test(timeout = 4000)
public void test78() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("\"^\"/[544hz7sJ5m$N3#");
assertEquals("\"^\"/[544hz7sJ5m$N3#", tokenQueue0.toString());
tokenQueue0.remainder();
assertTrue(tokenQueue0.isEmpty());
String string0 = tokenQueue0.consumeCssIdentifier();
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test79() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("%X");
tokenQueue0.consume();
tokenQueue0.consumeElementSelector();
assertEquals("", tokenQueue0.toString());
}
@Test(timeout = 4000)
public void test80() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("hL1R5=ze");
String string0 = tokenQueue0.toString();
assertEquals("hL1R5=ze", string0);
}
@Test(timeout = 4000)
public void test81() throws Throwable {
TokenQueue tokenQueue0 = new TokenQueue("");
// Undeclared exception!
try {
tokenQueue0.matchesCS((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
}
}
}
| java |
<gh_stars>0
{
"name": "readpaths",
"version": "1.0.0",
"description": "tiny script to read file paths and return and array of file paths",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "<EMAIL>",
"license": "ISC"
}
| json |
<reponame>Xtuden-com/airwaves
{
"id": "d226-79",
"text": "-15-\nTable 11\nWBAA Afternoon and Evening Audience\n15M Period Beginning:\nShare of Audience\nProgram Type Aired: *\n11:30\n1%\nSchool of the Air or NAEB program\n11:45\n4%\nNews\n12:00\n6%\nFarm markets and farm news\n12:15\n0%\nFarm markets and farm news\n5:30\n5%\nSports news\n5:45\n3%\nNews\n6:00\n5%\nDinner music\n6:15\n3%\nDinner music\n7:30\n4%\nClassical music\n7:45\n3%\nClassical music\n8:00\n5%\nClassical music\n8:15\n6%\nClassical music\n* NOTE: Many of these standard programs sometimes give way to special broadcasts,\nespecially in the 7:30 to 8:30 spot, such as a special sports broadcast."
} | json |
<filename>HIVE MIND.py
import datetime
class hivemind:
class mind:
class neurone:
def __init__(self,name,resistance=0,accelerate=0.999,brake=0.999,bayeslearningrate=10):
import random
self.learningrate={}
self.bayeslearningrate=bayeslearningrate
self.inputs={}
self.bias={}
self.bayesbias={}
if isinstance(resistance,str):
self.resistance=ramdom.random()
else:
self.resistance=resistance
self.pain=2
self.fired=[]
self.name=name
self.temp={}
self.me=0
self.accelerate=accelerate
self.brake=brake
def forward(self,imp={},bayes={},error=0):
import random
a=0
c=0
for i in bayes:
if i in self.bayesbias:
try:
c+=(self.bayesbias[i]*bayes[i])
except Exception as ex:
template = "An exception of type {0} occurred. Arguments:\n{1!r}"
message = template.format(type(ex).__name__, ex.args)
print(message)
print(c)
print(self.bayesbias[i])
print(bayes[i])
print(i)
print(bayes)
input("pause in forward")
else:
if error==2:
print(i)
print(self.bayesinputs)
input("pause")
self.bayesbias[i]=random.random()
self.learningrate[i]=random.random()
c+=self.bayesbias[i]
c=self.outputactivation(c)
if error==1:
print(self.name)
print(c)
input()
if c > self.resistance or self.name=="output":
a=0
for i in imp:
if i in self.bias:
a+=(self.bias[i]*imp[i])
else:
self.bias[i]=random.random()
a=self.outputactivation(a)
self.fired=imp
self.pain=a
return [self.name,a,c]
else:
return []
def backwards(self,actual,estimate,lisp,error=0):
import random
if self.name in lisp or self.name=='output':
if len(self.fired)>0:
a=0
c=actual-abs(estimate)
d=estimate/actual
e=0
if c > 0:
if self.pain < 0:
if actual >0:
sel=0
else:
sel=1
else:
sel=1
else:
if self.pain < 0:
if actual >0:
sel=1
else:
sel=0
else:
sel=0
for i in self.fired:
if i in self.temp:
if sel==1 and self.temp == 1:
self.learningrate[i]=self.learningrate[i]*self.accelerate
else:
self.learningrate[i]=self.learningrate[i]*self.brake
#self.temp[i]=c
try:
if c>0:
for i in self.fired:
self.bias[i]+=self.learningrate[i]
self.bayesbias[i]+=(self.learningrate[i]/self.bayeslearningrate)
self.temp[i]=sel
else:
for i in self.fired:
self.bias[i]-=self.learningrate[i]
self.bayesbias[i]-=(self.learningrate[i]/self.bayeslearningrate)
self.temp[i]=sel
except Exception as ex:
template = "An exception of type {0} occurred. Arguments:\n{1!r}"
message = template.format(type(ex).__name__, ex.args)
print(message)
print(self.fired)
print(i)
input("Error in backwards")
temp=self.fired.copy()
self.fired=[]
return temp
#mind needs to take the reply and group all the returns and then feed into next row.
#if mind gets a empty dict back for whole line then it needs to cycle through neurones and top up the bayes dict
def nonresponse(self,estimate):
import random
for i in estimate:
if i !=self.name:
if i in self.bayesbias:
self.bayesbias[i]+=1
else:
self.bayesbias[i]=random.random()+1
self.learningrate[i]=random.random()
def experience(self):
self.accelerate-=0.00000001
self.brake-=0.00000001
if self.brake<0.00000001:
self.brake=0.00000001
if self.accelerate < 1.00000001:
self.accelerate=1.00000001
def reset(self):
self.fired=[]
class Relu:
def outputactivation(self,x):
if x > 0:
return x
else:
return (x*0.1)
return 1 / (1 + math.exp(-x))
class Sigmoid:
def outputactivation(self,x):
import math
return 1 / (1 + math.exp(-x))
class Tanh:
def outputactivation(self,x):
import math
x=math.tanh(x)
return x
class sigmoidneurone(Sigmoid,neurone):
pass
class reluneurone(Relu,neurone):
pass
class tanhneurone(Tanh,neurone):
pass
def __init__(self,width,depth,repeat=0,resistance=0,bayeslearningrate=10,linearegression=0):
self.outputbias={}
self.mind=[]
self.source=[]
self.fired={}
self.repeat=repeat
self.me=0
self.critime={}
self.resistance=resistance
c=0
for i in range(depth):
cortex=[]
for w in range(width):
c+=1
name=str("No:"+str(c)+" row:"+str(i)+" width:"+str(w))
cortex.append(self.reluneurone(name,resistance=resistance,bayeslearningrate=bayeslearningrate))
if linearegression==1:
name='output'
self.output=self.reluneurone(name,resistance=0,bayeslearningrate=bayeslearningrate)
self.mind.append(cortex.copy())
name='output'
self.output=self.reluneurone(name,resistance=0,bayeslearningrate=bayeslearningrate)
def labotomy(self,width=[4,4,4,4,4],typo=['r','r','r','r','r','r'],resistance=[0,0,0,0,0,0],bayeslearningrate=[10,10,10,10,10],linearegression=[0,0,0,0,0]):
count=0
work=4
self.mind=[]
rest=0
bayes=10
c=0
for i in range(len(typo)):
try:
work=width[count]
rest=resistance[count]
bayes=bayeslearningrate[count]
except:
pass
cortex=[]
for w in range(work):
c+=1
name=str("No:"+str(c)+" row:"+str(i)+" width:"+str(w))
if typo[i].lower()=='r':
cortex.append(self.reluneurone(name,resistance=resistance,bayeslearningrate=bayeslearningrate))
if typo[i].lower()=='s':
cortex.append(self.sigmoidneurone(name,resistance=resistance,bayeslearningrate=bayeslearningrate))
if typo[i].lower()=='t':
cortex.append(self.tanhneurone(name,resistance=resistance,bayeslearningrate=bayeslearningrate))
if linearegression[i].lower()==1:
name='output'
self.output=self.reluneurone(name,resistance=resistance,bayeslearningrate=bayeslearningrate)
self.mind.append(cortex.copy())
count+=1
name='output'
self.output=self.reluneurone(name,resistance=resistance,bayeslearningrate=bayeslearningrate)
def forwardpage(self,inputs,error=0):
output=0
nay={}
bay={}
responsenay={}
responsebay={}
for i in inputs:
if isinstance(i,(int,float)):
nay[i]=i
bay[i]=i
else:
nay[i]=1
bay[i]=1
if error==2:
print(inputs)
for cortex in range(len(self.mind)):
responsenay={}
responsebay={}
for nerve in self.mind[cortex]:
response=nerve.forward(nay,bay)
if len(response) >0:
responsenay[response[0]]=response[1]
responsebay[response[0]]=response[2]
if len(responsenay)==0:
for nerve in self.mind[cortex]:
nerve.nonresponse(bay)
if error==2:
print(responsenay)
print(responsebay)
input("pause error 2 at forward page")
nay=responsenay
bay=responsebay
response=self.output.forward(nay,bay)
if len(response)==0:
self.output.nonresponse(bay)
self.output.nonresponse(bay)
else:
output=response[1]
return output
def slow(self):
for cortex in range(len(self.mind)):
for nerve in self.mind[cortex]:
nerve.experience()
def backapage(self,actual,estimate,error=0):
nex=[]
r=[]
if estimate==None:
estimate=0
nex=self.output.backwards(float(actual),float(estimate),[])
#print(nex)
#input()
for cortex in reversed(self.mind):
for nerve in cortex:
try:
response=nerve.backwards(float(actual),float(estimate),nex)
for re in response:
if not re in r:
r.append(re)
except Exception as ex:
pass
nex=r
#print(nex)
#input("Previous Rows")
self.fired=0
def learnbook(self,reader,element,accuracy=30,epochs=10,error=0,key=0,SECONDREAD=0):
estimate=0
lastcount=1
count=1
rightcount=0
mike=0
check=0
for row in reader:
if row.get(element):
project_list=list(row.values())
project_list.remove(row.get(element))
estimate=self.forwardpage(project_list)
self.backapage(row.get(element),estimate)
step=0
temp=0
while step < epochs:
lastcount=rightcount
consider=[0,0,0,0,0,0,0,0,0,0,0,0,0]
count=1
for row in reader:
if row.get(element):
count+=1
project_list=list(row.values())
if key !=0:
project_list.remove(row.get(key))
project_list.remove(row.get(element))
estimate=self.forwardpage(project_list)
if row.get(element) !=0:
self.backapage(row.get(element),estimate)
if error==1:
print(estimate)
print(row.get(element))
input("pause for error in learnbook")
try:
temp=int(round(abs(estimate-row.get(element))/accuracy,0))
except:
pass
try:
consider[temp]+=1
except Exception as ex:
pass
if error==1:
print(project_list)
print(row.get(element))
print(estimate)
print(lastcount)
input("pause error 1 in learnbook")
cumu=0
rightcount=consider[0]/count
if rightcount <check:
self.slow()
check=rightcount
for i in range(len(consider)):
cumu+=((consider[i]/count)*100)
#print("Within a accuracy " + str(i) + " we had a accuracy of " + str((consider[i]/count)*100) + " with cumulatve of " + str(cumu))
step+=1
#print("New Epoch " + str(step))
if isinstance(SECONDREAD,list):
for row in SECONDREAD:
project_list=list(row.values())
project_list.remove(row.get(element))
if key !=0:
project_list.remove(row.get(key))
estimate=self.forwardpage(project_list)
#if estimate < accuracy:
# estimate=accuracy
if error==2:
print(row)
print(project_list)
input("Error 2 in learnbook")
try:
row["ESTIMATE"]=round(estimate,0)
except:
row["ESTIMATE"]="None response from AI, unrecognised engram - pleaser forecast manually"
return SECONDREAD
def prognosticate(self,reader,key,element):
newreader=[]
for row in reader:
newrow={}
project_list=list(row.values())
project_list.remove(row.get(element))
estimate=self.forwardpage(project_list)
if estimate < 30:
estimate=30
for cortex in reversed(self.mind):
for nerve in cortex:
nerve.reset()
estimate=round(estimate,0)
newrow[key]=row[key][-(len(row[key])-(len(key)+1)):]
newrow[str(element)+" Estimate"]=estimate
newreader.append(newrow.copy())
return newreader
def testday(self,reader,accuracy,element,key=0):
newreader=[]
step=0
count=0
eva=0
eve=0
errors=0
checkframe=[]
fileframe=[]
column=0
row=0
for row in reader:
try:
eve+=row.get(element)
count+=1
except:
print(row)
print(row.get(element))
input("error in testday")
try:
average=eve/count
except:
average=0
eve=0
count=0
var=0
hypo=0
for row in reader:
count+=1
newrow={}
project_list=list(row.values())
project_list.remove(row.get(element))
if key !=0:
project_list.remove(row.get(key))
estimate=self.forwardpage(project_list)
try:
eva=estimate-row.get(element)
except:
errors+=1
if abs(eva) < accuracy:
step+=1
var=abs(row.get(element)-average)
hypo+=(var*var)
eve+=(eva*eva)
for cortex in reversed(self.mind):
for nerve in cortex:
nerve.reset()
try:
return [(step/count),(eve/count),errors,hypo/count,]
except:
return [0,0,errors,0,]
def __init__(self,reader,key,startdate,endate,renamekey,start=1,accuracy=15,csvloci=r'C:\CSVs\\',setcritdelay=14,setalert=0,taskmove=1,setpercntile=0.95,setdependency=1):
self.source=[]
self.innaccurate=[]
self.accuraccy=accuracy
self.key=key
self.uPDATE=0
self.renamekey=renamekey
self.startdate=startdate
import os
directory=csvloci+'Analysis\\'
if not os.path.exists(directory):
try:
os.makedirs(directory)
except OSError:
print ('Error: Creating directory. ' + directory)
self.csvloci=directory
directory=csvloci+'BrainsInAJar\\'
if not os.path.exists(directory):
try:
os.makedirs(directory)
except OSError:
print ('Error: Creating directory. ' + directory)
self.geniusloci=directory
directory=csvloci+'Analysis\\'
if not os.path.exists(directory):
try:
os.makedirs(directory)
except OSError:
print ('Error: Creating directory. ' + directory)
self.analysisloci=directory
directory=csvloci+'HIVE\\'
if not os.path.exists(directory):
try:
os.makedirs(directory)
except OSError:
print ('Error: Creating directory. ' + directory)
self.hiveloci=directory
self.enddate=endate
self.hive(reader,startdate)
if start!=0:
if start=="test":
self.randomdata()
else:
self.swarm()
#self.workplanner()
def run(self,reader,queenme=0):
if len(self.deps)==0:
try:
self.deps=self.Open(file_Name=self.geniusloci + '\DEPENDENCIES_FILE')
if self.deps==False:
self.deps={}
except:
self.deps={}
try:
self.tickboxes=self.Open(file_Name=self.geniusloci + '\TICKBOX_FILE')
if self.tickboxes==False:
self.tickboxes={}
except:
self.tickboxes={}
try:
self.alerts=self.Open(file_Name=self.geniusloci +'\ALERT_FILE')
if self.alerts==False:
self.alerts={}
except:
self.alerts={}
try:
self.critime=self.Open(file_Name=self.geniusloci +'\CRITIME_FILE')
if self.critime==False:
self.critime={}
except:
self.critime={}
try:
self.hardforward=self.Open(file_Name=self.geniusloci+'\HARD_FILE')
if self.hardforward==False:
self.hardforward={}
except:
self.hardforward={}
self.hive(reader,self.startdate)
x = threading.Thread(target=self.swarm, args=(self.startdate))
x.start()
q = threading.Thread(target=self.reforecast, args=())
q.start()
if queenme==1:
queeme=threading.Thread(target=self.queen, args=())
queeme.start()
def reference(self):
print("Building the Hive")
print("this is the dates i have found")
print(self.dates)
print(len(self.dates))
print("this is the labels i have found")
print(self.kill)
print(len(self.kill))
print("this is the numbers i have found")
print(self.numbers)
print(len(self.numbers))
def hive(self,reader,startdate,error=0):
def inreader(row,reader,key):
count=0
for newrow in reader:
if row[key]==newrow[key]:
return count
count+=1
return False
def addrow(row,startdate):
newrow={}
newrow["end"]=row[self.enddate]
newrow[self.key]=row[self.key]
newrow[startdate]=row[startdate]
datarea={}
for d in self.dates:
temp=self.tryfindcmrdates(newrow[startdate],row[d])
try:
if temp > 0:
dateme[d]=1
except:
pass
datarea[d]=self.tryfindcmrdates(newrow[startdate],row[d])
#print(datarea.copy())
#input()
newrow["Dates"]=datarea.copy()
datarea={}
for n in self.numbers:
try:
if isinstance(float(row[n]),(float,int)):
datarea[n]=float(row[n])
else:
datarea[n]=None
except:
datarea[n]=None
pass
newrow["Numbers"]=datarea.copy()
for k in self.kill:
if k in row:
if isinstance(row[k],str):
if not self.isdate(row[k]):
if not len(row[k])==0:
if error==1:
print(row[self.key])
print(k)
input(row[k])
datarea[k]=str(k)+':' +str(row[k])
newrow["Labels"]=datarea.copy()
if row[self.key] in tempforecastdates:
newrow["Forecast Dates"]=tempforecastdates[row[self.key]]
del tempforecastdates[row[self.key]]
else:
newrow["Forecast Dates"]={}
if row[self.key] in tempforecastnumbers:
newrow["Forecast Numbers"]=tempforecastnumbers[row[self.key]]
del tempforecastnumbers[row[self.key]]
else:
newrow["Forecast Numbers"]={}
newrow["Reforecast Dates"]={}
newrow["Overide Dates"]={}
newrow["Overide Numbers"]={}
return newrow
if len(self.source)==0:
tech=[]
self.dates=[]
self.numbers=[]
self.kill=[]
tempforecastdates={}
tempforecastnumbers={}
for s in self.source:
tempforecastdates[s[self.key]]=s["Forecast Dates"]
tempforecastnumbers[s[self.key]]=s["Forecast Numbers"]
for row in reader:
for cell in row:
if self.isdate(row[cell]) and cell !=self.key and cell !=startdate:
if not cell in self.dates:
self.dates.append(cell)
try:
if isinstance(float(row[cell]),(float,int)):
if cell !=self.key and cell !=startdate:
if not cell in self.numbers:
self.numbers.append(cell)
except:
pass
if isinstance(row[cell],str) and cell !=self.key and cell !=startdate:
if not isinstance(row[cell],(float,int)):
if not cell in self.kill:
self.kill.append(cell)
now=''
now=self.today
for row in reader:
tech.append(addrow(row,self.startdate))
self.source=tech
else:
temp=[]
for row in reader:
temp=inreader(source,self.source,self.key)
if temp==False:
self.source.append(addrow(row,now))
else:
for d in self.dates:
self.source[temp]["Dates"][d]=row[d]
for n in self.numbers:
self.source[temp]["Numbers"][n]=row[n]
for k in self.kill:
self.source[temp]["Labels"][k]=row[k]
def swarm(self,error=0):
print("Forecasting Dates")
for d in self.dates:
tempreader=[]
otherereader=[]
for row in self.source:
if not d in row["Labels"]:
newrow={}
newrow["TARGET"]=row["Dates"][d]
for k in row["Labels"]:
if k !=d:
newrow[k]=row["Labels"][k]
newrow[self.key]=row[self.key]
if newrow["TARGET"]==None:
otherereader.append(newrow.copy())
else:
if newrow["TARGET"] < 0:
newrow["TARGET"]=0
tempreader.append(newrow.copy())
elif error==1:
print(row[self.key])
print(d)
input()
#print(d)
#self.timestamp()
#print(len(tempreader))
#print(len(otherereader))
#try:
r2=[]
#print(d)
STRING=d.replace('/','-')
mymind=self.Open(file_Name=self.geniusloci + '\prognostication' + STRING + '_BRAININAJAR')
if mymind==False:
mymind=self.mind(4,5)
epo=1
else:
epo=1
r2=mymind.learnbook(tempreader,"TARGET",accuracy=self.accuraccy,epochs=epo,key=self.key,SECONDREAD=otherereader)
for row in self.source:
row=self.updaterow(row,r2,self.key,d)
self.Save(mymind,file_Name=self.geniusloci + '\prognostication' + STRING + '_BRAININAJAR')
self.csvwrite(r2,CSV=self.hiveloci + '\prognostication' + STRING + '_OUTPUT.csv',KEY=self.key,NEWKEY=self.renamekey)
csv=[]
#print(self.csvloci+'\Test_Records_' + STRING + '_OUTPUT.csv')
csv=self.csvopen(x=(self.csvloci+'\Test_Records_' + STRING + '_OUTPUT.csv'))
vale=mymind.testday(tempreader,self.accuraccy,"TARGET",key=self.key)
data={}
data["Type"]=d
data["Accuraccy"]=vale[0]
data["Loss Function"]=vale[1]
data["Date"]=self.today()
data["Variance Around Average"]=vale[3]
if vale[3]==0:
data["Hypothesis Test"]="Error in hypothesis test"
else:
data["Hypothesis Test"]=vale[1]/vale[3]
if vale[1]/vale[3] > 1:
self.innaccurate.append(d)
elif d in self.innaccurate:
self.innaccurate.remove(d)
data["Errors"]=vale[2]
csv.append(data)
self.csvwrite(csv,CSV=self.analysisloci +'\Test_Records_' + STRING + '_OUTPUT.csv',KEY="Type",NEWKEY=0)
#except:
# print(d)
# print("We found no instances of this to forecast, press enter too accept")
# input()
tempreader=[]
LOAD=''
concat=''
unload=[]
for row in self.source:
if len(row["end"]) == 0:
try:
unload=min(row["Forecast Dates"])
except:
print(row["Dates"])
print(row["Forecast Dates"])
input()
datarea={}
datarea[self.key]=row[self.key]
datarea["Next Task"]=unload
datarea["Date"]=self.today()
tempreader.append(datarea.copy())
self.csvwrite(tempreader,CSV=self.analysisloci + 'prognostication' + '_Next_Task_' + '_OUTPUT.csv',KEY=self.key,NEWKEY=self.renamekey)
self.uPDATE=0
print("Forecasting Numbers")
for d in self.numbers:
tempreader=[]
otherereader=[]
for row in self.source:
newrow={}
newrow[self.key]=row[self.key]
if len(row["end"])>0:
#print(row["Numbers"])
#print(row["end"])
#input()
newrow["TARGET"]=row["Numbers"][d]
else:
newrow["TARGET"]=None
for k in row["Labels"]:
if k !=d:
newrow[k]=row["Labels"][k]
if newrow["TARGET"]==None:
otherereader.append(newrow.copy())
elif isinstance(newrow["TARGET"],(int,float)):
tempreader.append(newrow.copy())
if len(tempreader) >0:
#try:
r2=[]
#print(d)
STRING=d.replace('/','-')
mymind=self.Open(file_Name=self.geniusloci + '\prognostication' + STRING + '_BRAININAJAR')
if mymind==False:
mymind=self.mind(4,5)
epo=1
else:
epo=1
r2=mymind.learnbook(tempreader,"TARGET",accuracy=self.accuraccy,epochs=epo,key=self.key,SECONDREAD=otherereader)
STRING=d.replace('/','-')
self.csvwrite(r2,CSV=self.hiveloci + '\prognostication' + STRING + '_OUTPUT.csv',KEY=self.key,NEWKEY=self.renamekey)
self.Save(mymind,file_Name=self.geniusloci + '\prognostication' + STRING + '_BRAININAJAR')
#except:
# print(d)
# print("We found no instances of this to forecast, press enter too accept")
# input()
csv=[]
csv=self.csvopen(x=(self.csvloci+'\Test_Records_' + STRING + '_OUTPUT.csv'))
vale=mymind.testday(tempreader,self.accuraccy,"TARGET",key=self.key)
data={}
data["Type"]=d
data["Accuraccy"]=vale[0]
data["Loss Function"]=vale[1]
data["Date"]=self.today()
data["Variance Around Average"]=vale[3]
if vale[3]==0:
data["Hypothesis Test"]="Error in hypothesis test"
else:
data["Hypothesis Test"]=vale[1]/vale[3]
if vale[1]/vale[3] > 1:
self.innaccurate.append(d)
elif d in self.innaccurate:
self.innaccurate.remove(d)
data["Errors"]=vale[2]
csv.append(data)
self.csvwrite(csv,CSV=self.analysisloci + '\Test_Records_' + STRING + '_OUTPUT.csv',KEY="Type",NEWKEY=0)
self.swarmin=0
print("Innaccurate models detected")
print(self.innaccurate)
def Save(self,a,file_Name):
import pickle
fileObject = open(file_Name,'wb')
pickle.dump(a,fileObject)
fileObject.close()
def Open(self,file_Name):
import os.path
if os.path.isfile(file_Name)==True:
import pickle
fileObject = open(file_Name,'rb')
try:
b = pickle.load(fileObject,encoding="utf8")
return b
except:
print(file_Name)
print("got a error in opening pickle RESTARTING FILE")
return False
else:
return False
def updaterow(self,row,r2,key,d,look="Forecast Dates",error=0):
for r in r2:
if row[self.key]==r[self.key]:
if r["ESTIMATE"] !="None response from AI, unrecognised engram - pleaser forecast manually":
row[look][d]=r["ESTIMATE"]
return row
return row
def isdate(self,check):
from datetime import datetime
try:
h=check.split('/')
x=datetime(int(h[2]), int(h[1]), int(h[0]), 0, 0, 0, 0)
return True
except:
return False
def today(self):
from datetime import datetime
check = datetime.now()
return (str(check.day)+'/'+str(check.month)+'/'+str(check.year))
def tryfindcmrdates(self,a,b):
from datetime import datetime
try:
h=a.split('/')
x=datetime(int(h[2]), int(h[1]), int(h[0]), 0, 0, 0, 0)
t=b.split('/')
t=datetime(int(t[2]), int(t[1]), int(t[0]), 0, 0, 0, 0)
dt = t - x
return dt.days
except:
return None
def csvwrite(self,reader,CSV='C:\CSVs\OUTPUT.csv',KEY=0,NEWKEY=0):
import csv
fieldnombre=[]
for row in reader:
for cell in row:
if not cell in fieldnombre:
fieldnombre.append(cell)
if NEWKEY !=0:
try:
fieldnombre.remove(KEY)
except:
pass
fieldnombre.append(NEWKEY)
for row in reader:
row[NEWKEY]=row.get(KEY)
frame=[]
with open(CSV, 'w', newline='') as csvfile:
spamwriter = csv.writer(csvfile, delimiter=',',
quotechar='"', quoting=csv.QUOTE_MINIMAL)
spamwriter.writerow(fieldnombre)
for row in reader:
frame=[]
for field in fieldnombre:
frame.append(row.get(field))
spamwriter.writerow(frame.copy())
csvfile.close()
def csvopen(self,x):
import csv
import os.path
if os.path.isfile(x)==False:
return []
with open(x, newline='') as csvfile:
data = csv.DictReader(csvfile)
reader = [item for item in data]
newreader=[]
data=None
count=0
return reader
def randomdata(self):
import random
for row in self.source:
for d in self.dates:
row["Forecast Dates"][d]=random.randint(0,120)
for n in self.numbers:
row["Forecast Numbers"][d]=random.randint(0,120)
def multitest(self,reader,tag):
innaccurate=[]
def makeworksheet(typo,reader,num):
newreader=[]
if num==True:
for row in reader:
if self.key in row:
newrow={}
try:
newrow[self.key]=row[self.key]
except:
print(row)
print(newrow)
input("error in makeworksheet")
if isinstance(row[typo],(int,float)):
newrow["TARGET"]=self.tryfindcmrdates(row[self.startdate],row[typo])
for k in self.kill:
if k in row:
if isinstance(row[k],str):
if not self.isdate(row[k]):
if not len(row[k])==0:
newrow[k]=str(k)+':' +str(row[k])
newreader.append(newrow.copy())
else:
for row in reader:
if self.key in row:
newrow={}
try:
newrow[self.key]=row[self.key]
except:
print(row)
print(newrow)
input("error in makeworksheet")
if self.isdate(row[self.startdate]):
if self.isdate(row[typo]):
newrow["TARGET"]=self.tryfindcmrdates(row[self.startdate],row[typo])
for k in self.kill:
if k in row:
if isinstance(row[k],str):
if not self.isdate(row[k]):
if not len(row[k])==0:
newrow[k]=str(k)+':' +str(row[k])
newreader.append(newrow.copy())
return newreader
for d in self.dates:
tempreader=makeworksheet(d,reader,False)
print("multitest")
print(d)
print(len(tempreader))
if len(tempreader)>0:
STRING=d.replace('/','-')
mymind=self.Open(file_Name=self.geniusloci + '\prognostication' + STRING + '_BRAININAJAR')
csv=[]
csv=self.csvopen(x=(self.csvloci+'\Test_Records_' + STRING + '_OUTPUT.csv'))
try:
vale=mymind.testday(tempreader,self.accuraccy,"TARGET",key=self.key)
except:
print(vale)
input("error")
data={}
data["Type"]=d
data["Accuraccy"]=vale[0]
data["Loss Function"]=vale[1]
data["Date"]=self.today()
data["Tag"]=tag
data["Variance Around Average"]=vale[3]
if vale[3]==0:
data["Hypothesis Test"]="Error in hypothesis test"
else:
data["Hypothesis Test"]=vale[1]/vale[3]
if vale[1]/vale[3] > 1:
innaccurate.append(d)
data["Errors"]=vale[2]
csv.append(data)
self.csvwrite(csv,CSV=self.analysisloci + '\Test_Records_' + STRING + '_OUTPUT.csv',KEY="Type",NEWKEY=0)
for d in self.numbers:
tempreader=makeworksheet(d,reader,True)
print("multitest")
print(d)
print(len(tempreader))
if len(tempreader)>0:
STRING=d.replace('/','-')
mymind=self.Open(file_Name=self.geniusloci + '\prognostication' + STRING + '_BRAININAJAR')
csv=[]
csv=self.csvopen(x=(self.csvloci+'\Test_Records_' + STRING + '_OUTPUT.csv'))
vale=mymind.testday(tempreader,self.accuraccy,"TARGET",key=self.key)
data={}
data["Type"]=d
data["Accuraccy"]=vale[0]
data["Loss Function"]=vale[1]
data["Date"]=self.today()
data["Tag"]=tag
data["Variance Around Average"]=vale[3]
if vale[3]==0:
data["Hypothesis Test"]="Error in hypothesis test"
else:
data["Hypothesis Test"]=vale[1]/vale[3]
if vale[1]/vale[3] > 1:
innaccurate.append(d)
data["Errors"]=vale[2]
csv.append(data)
self.csvwrite(csv,CSV=self.analysisloci + '\Test_Records_' + STRING + '_OUTPUT.csv',KEY="Type",NEWKEY=0)
print("Inaccuracies in Historic Data Found")
print(innaccurate)
def workplanner(self,setcritdelay=0,setalerts=0,taskmove=0,setpercntile=0,setdependency=0):
averageburndown={}
countdates={}
burndown=0
evaluate=[]
csv=[]
csv=self.csvopen(x=(self.hiveloci+'\RESOURCE PLAN.csv'))
if len(csv)==0:
for d in self.dates:
newrow={}
newrow["Type"]=d
csv.append(newrow.copy())
self.csvwrite(csv,CSV=(self.csvloci+'\RESOURCE PLAN.csv'),KEY=0,NEWKEY=0)
newrow={}
dat={}
for c in csv:
dat[c['Task']]={}
for s in c:
if s !=dat[c['Task']]:
dat[c['Task']][s]=c[s]
for row in self.source:
if len(row[self.startdate])>0:
if len(row["end"])==0:
todah=self.tryfindcmrdates(row[self.startdate],self.today())
for d in row["Forecast Dates"]:
if not d in self.innaccurate:
if row["Dates"][d]==None:
if not d in row["Labels"]:
count=1
check=1
reforecast=0
newrow={}
for e in row["Forecast Dates"]:
if not e in self.innaccurate:
if e !=d:
if not e in row["Labels"]:
if row["Forecast Dates"][e]!=None:
if row["Dates"][e]!= None and row["Forecast Dates"][d]>row["Dates"][e]:
count+=1
elif row["Forecast Dates"][d]>row["Forecast Dates"][e]:
count+=1
if row["Dates"][e]==None:
check+=1
burndown=row["Forecast Dates"][d]/count
if burndown < 0 or burndown==row["Forecast Dates"][d]:
burndown=0
reforecast=round(todah+(check*burndown))
newrow[self.renamekey]=row[self.key]
newrow["Reforecast"]=reforecast
newrow["Burndown"]=burndown
newrow["Type"]=d
newrow["Previous Tasks"]=count
newrow["Original Forecast"]=row["Forecast Dates"][d]
newrow["Previous Tasks Remainder"]=check
if todah > row["Forecast Dates"][d]:
if todah > (row["Forecast Dates"][d]*1.5):
newrow["Late Flag"]="Late - long delay"
else:
newrow["Late Flag"]="Late"
elif reforecast < row["Forecast Dates"][d]:
newrow["Late Flag"]="Running Ahead"
elif (row["Forecast Dates"][d]-reforecast)<burndown:
newrow["Late Flag"]="On Schedule"
else:
newrow["Late Flag"]="Behind Schedule"
if d in dat:
for a in dat[d]:
if a !=d:
newrow[a]=dat[d][a]
evaluate.append(newrow.copy())
self.csvwrite(evaluate,CSV=(self.hiveloci+'\prognostication_REFORECAST.csv'),KEY=0,NEWKEY=0)
def scheduletests(self):
csv=[]
import collections
for me in self.dates:
import random
ra=[]
for m in range(20):
ra.append(m)
print(ra)
ra=random.sample(ra,len(ra))
print(ra)
for L in range(1):
for r in ra:
for b in ra:
for d in ra:
for w in ra:
newrow=collections.OrderedDict()
newrow["Type"]=me
newrow["width"]=w+1
newrow["depth"]=d+1
newrow["resistance"]=r/10
newrow["bayeslearningrate"]=b+1
newrow["linearegression"]=L
newrow["epochs"]=1
newrow["n"]=False
yield newrow
for d in self.numbers:
for l in range(1):
for r in ra:
for b in ra:
for d in ra:
for w in ra:
newrow=collections.OrderedDict()
newrow["Type"]=d
newrow["width"]=w+1
newrow["depth"]=d+1
newrow["resistance"]=r/10
newrow["bayeslearningrate"]=b+1
newrow["linearegression"]=l
newrow["epochs"]=1
newrow["n"]=True
yield newrow
def makeworksheet(self,d,reader,num):
if num==True:
tempreader=[]
otherereader=[]
for row in self.source:
newrow={}
newrow[self.key]=row[self.key]
if len(row["end"])>0:
#print(row["Numbers"])
#print(row["end"])
#input()
newrow["TARGET"]=row["Numbers"][d]
else:
newrow["TARGET"]=None
for k in row["Labels"]:
if k !=d:
newrow[k]=row["Labels"][k]
if newrow["TARGET"]!=None:
if newrow["TARGET"] > 0:
otherereader.append(newrow.copy())
else:
tempreader.append(newrow.copy())
else:
tempreader=[]
otherereader=[]
for row in self.source:
if not d in row["Labels"]:
newrow={}
newrow["TARGET"]=row["Dates"][d]
for k in row["Labels"]:
if k !=d:
newrow[k]=row["Labels"][k]
newrow[self.key]=row[self.key]
if newrow["TARGET"]==None:
otherereader.append(newrow.copy())
else:
if newrow["TARGET"] < 0:
newrow["TARGET"]=0
tempreader.append(newrow.copy())
return [tempreader,otherereader]
def queen(self,overide=0):
def chack(reader,find):
for row in reader:
if row["Type"]==find:
return True
return False
def getacc(tye):
STRING=tye.replace('/','-')
try:
CSV=self.csvopen(self.analysisloci + '\Test_Records_' + STRING + '_OUTPUT.csv')
except:
return False
ROW=CSV[(len(CSV)-1)]
vale=[]
vale.append(float(ROW["Loss Function"]))
vale.append(eval(ROW["Accuraccy"]))
vale.append((len(CSV)))
return vale
bestwidth=0
otherereader=[]
tempreader=[]
val1=[]
val2=[]
import random
import collections
comptests=[]
#def __init__(self,width,depth,repeat=0,resistance=0,bayeslearningrate=10,linearegression=0):
#def labotomy(self,width=[4,4,4,4,4],typo=['r','r','r','r','r','r'],resistance=[0,0,0,0,0,0],bayeslearningrate=[10,10,10,10,10]):
csv=self.csvopen(x=(self.csvloci+'\Test_Records_SCHEDULED_TESTS.csv'))
newcsv=[]
ty=''
for row in csv:
if len(row["date"])>0:
work=[]
if not ty ==row["Type"]:
ty =row["Type"]
tempreader=[]
otherereader=[]
work=self.makeworksheet(row["Type"],self.source,row["number"])
tempreader=work[0]
otherereader=work[1]
testmind=self.mind(width=int(row["width"]),depth=int(row["depth"]),resistance=int(row["resistance"]),bayeslearningrate=int(row["bayeslearningrate"]),linearegression=int(row["linearegression"]))
try:
if len(row["labotomy.width"]) > 0:
testmind.labotomy(width=eval(row["labotomy.width"]),depth=eval(row["labotomy.width"]),resistance=int(row["labotomy.resistance"]),bayeslearningrate=eval(row["labotomy.bayeslearningrate"]),linearegression=eval(row["labotomy.linearegression"]))
except:
pass
testmind.learnbook(tempreader,"TARGET",accuracy=int(row["accuracy"]),epochs=int(row["epochs"]),key=self.key,SECONDREAD=otherereader)
val1=getacc(row["Type"])
val1e=testmind.testday(tempreader,int(row["accuracy"]),"TARGET",key=self.key)
row["percentage"]=val1e[0]
row["loss function"]=val1e[1]
row["date"]=self.today()
if val1e[0] > val1[0] and val1e[1] > val1[1]:
row["acceptance"]=1
STRING=str(row["Type"])
STRING=STRING.replace('/','-')
self.Save(testmind,file_Name=r'C:\CSVs\BrainsInAJar\prognostication' + STRING + '_BRAININAJAR')
row["Test passed type"]="Scheduled Test Passed"
comptests.append(row.copy())
self.csvwrite(comptests,CSV=(self.csvloci+'\Test_Records_COMPLETED_TESTS.csv'),KEY=0,NEWKEY=0)
else:
row["acceptance"]=0
c=0
import time
if len(comptests)==0:
genny=self.scheduletests()
ty=''
for row in genny:
work=[]
if ty !=row["Type"]:
tempreader=[]
otherereader=[]
ty =row["Type"]
work=self.makeworksheet(row["Type"],self.source,row["n"])
tempreader=work[0]
otherereader=work[1]
val1=getacc(row["Type"])
testmind=self.mind(width=int(row["width"]),depth=int(row["depth"]),resistance=int(row["resistance"]),bayeslearningrate=int(row["bayeslearningrate"]),linearegression=int(row["linearegression"]))
testmind.learnbook(tempreader,"TARGET",accuracy=self.accuraccy,epochs=val1[2],key=self.key,SECONDREAD=otherereader)
count=0
val1e=testmind.testday(tempreader,self.accuraccy,"TARGET",key=self.key)
row["percentage original"]=val1e[0]
row["loss function"]=val1e[1]
row["date"]=self.today()
print("%")
print(val1e[0])
print("old")
print(val1[1])
print("loss")
print(val1e[1])
print("old")
print(val1[0])
print("epochs")
print(val1[2])
print(len(tempreader))
print(len(otherereader))
print(str(row["depth"]))
print(str(row["width"]))
print(str(row["resistance"]))
print(str(row["bayeslearningrate"]))
if val1e[0] > val1[1] and val1e[1] < val1[0]:
val1[1]=val1e[0]
val1[0]=val1e[1]
print("upgrade")
row["acceptance"]=1
STRING=str(row["Type"])
STRING=STRING.replace('/','-')
print(STRING)
self.Save(testmind,file_Name=r'C:\CSVs\BrainsInAJar\prognostication' + STRING + '_BRAININAJAR')
row["Test passed type"]="Auto Generated Test Passed"
comptests.append(row.copy())
self.csvwrite(comptests,CSV=(self.csvloci+'\Test_Records_COMPLETED_TESTS.csv'),KEY=0,NEWKEY=0)
csv=self.csvopen(x=(self.csvloci+'\Test_Records_COMPLETED_TESTS.csv'))
for row in csv:
testmind=mind(width=int(row["width"]),depth=int(row["width"]),resistance=int(row["resistance"]),bayeslearningrate=int(row["bayeslearningrate"]),linearegression=int(row["linearegression"]))
if len(row["labotomy.width"]) > 0:
testmind.labotomy(width=eval(row["labotomy.width"]),depth=eval(row["labotomy.width"]),resistance=int(row["labotomy.resistance"]),bayeslearningrate=eval(row["labotomy.bayeslearningrate"]),linearegression=eval(row["labotomy.linearegression"]))
c=float(inf)
d=0
work=self.makeworksheet(row["Type"],self.source)
tempreader=work[0]
otherereader=work[1]
testmind.learnbook(tempreader,"TARGET",accuracy=int(row["accuraccy"]),epochs=1,key=self.key,SECONDREAD=otherereader)
vale=testmind.testday(tempreader,int(row["accuraccy"]),"TARGET",key=self.key)
count=1
while vale[1] < c and vale[2] > d:
testmind.learnbook(tempreader,"TARGET",accuracy=int(row["accuraccy"]),epochs=1,key=self.key,SECONDREAD=otherereader)
vale=testmind.testday(tempreader,int(row["accuraccy"]),"TARGET",key=self.key)
count+=1
count-=1
newrow=row.copy()
newrow["epochs"]=count
self.Save(testmind,file_Name=self.geniusloci + '\prognostication' + str(row["Type"]) + '_BRAININAJAR')
newrow["Test passed type"]="Evaluation of earlystopping"
csv.append(newrow.copy())
self.csvwrite(csv,CSV=(self.csvloci+'\Test_Records_COMPLETED_TESTS.csv'),KEY=0,NEWKEY=0)
self.queenIN=0
def timestamp(self):
import datetime
now = datetime.datetime.now()
print(now)
def readmaker(x=0,kill=[],educational=[],ConverTOstrings=[]):
import csv
import random
import datetime
now = datetime.datetime.now()
if len(str(now.month))==1:
t='0'+str(now.month)
else:
t=str(now.month)
if len(str(now.day))==1:
y='0'+str(now.day)
else:
y=str(now.day)
if x==0:
x='\\\\wcrwvfilprd01\\shared$\\Telecoms Reporting\\QlikView nPrinting Output\\CMR\\IS_CMR_' + str(now.year) + '-' + t + '-' + y + '.csv'
def infermeaning(reader,column):
text=''
textlist=[]
corpuscount={}
count=0
average=0
import math
for row in reader:
intext=[]
text=row.get(column)
if text !='':
if text:
textlist=text.split()
for t in textlist:
count+=1
if t in corpuscount:
corpuscount[t]+=1
else:
corpuscount[t]=1
for c in corpuscount:
corpuscount[c]=math.log(count/corpuscount[c])
average+=corpuscount[c]
average=average/count
newcorpuscount={}
for c in corpuscount:
if corpuscount[c] > average:
newcorpuscount[c]=corpuscount[c]
for row in reader:
text=row.get(column)
textlist=text.split()
for t in text:
if t in newcorpuscount:
row[t]=t
del row[column]
return reader
with open(x, newline='') as csvfile:
data = csv.DictReader(csvfile)
reader = [item for item in data]
newreader=[]
data=None
count=0
for row in reader:
for k in kill:
try:
del row[k]
except:
pass
for con in ConverTOstrings:
row["StrVer:"+str(con)]=con + ':' + str(row[con])
for e in educational:
reader=infermeaning(reader,e)
return reader
def ratiosplit(reader,ratio):
count=0
ratioreader=[]
oldreader=[]
for row in reader:
count+=1
newrow=row.copy()
if count % ratio==0:
ratioreader.append(newrow)
else:
oldreader.append(newrow)
return [oldreader,ratioreader]
#SECTION TO SETUP FOR YOUR OWN DATA - ONE # = CODE LINE MULTIPLE ###### NOTES
#####DECLARE TIME
##NOW=datetime.datetime.now()
#print(datetime.datetime.now())
##### ADD NAME OF FIELD TO CONVERTS TO CONVERT SOMETHING TO STRING
#converts=[]
##### EDUCATIONAL WILL SPLIT A COMMENTS FIELD
#edX=[]
##### KILL WILL DROP A FIELD
#kill=[]
##### x IS required as a raw string to indicate the string of the filepath where the CSV you want it to use exists
#x=r''
##### below line creates a list containing ordered dicts from a CSV that represents the
#r=readmaker(x=x,kill=kill,educational=edX,ConverTOstrings=converts)
##### splits data, assumes a ratio of 5 learn to 1 test change to taste, relies on data output being sorted. Hint i suggest sort on key
#r=ratiosplit(r,5)
#r2=r[1]
#r=r[0]
##### relies on knowing the key for the CSV need to
#lockpick='KEY FOR WORK NEEDS  before string of key'
#update='KEY FOR WORK DOES NOT NEED NEEDS  before string of key - RENAMES KEY AND REMOVES  FOR FINAL OUTPUT'
##### START AND END
#START='FIELD NAME OF START DATE'
#END='FIELD NAME OF END DATE'
#ACCURACY=NUMBER OF DAYS YOU FIND AN ACCEPTABLE "CORRECT FORECAST"
#csvloci=
#csvloci=SUGGESTED: r'C:\CSVs\\' FILE LOCATION TO OUTPUT DATA AND BBUILD DATABASE AS LONG AS POINTED AT SAME LOCATION AT TIME WILL REUSE SAME AI
##### THE CODE THAT BUILDS MINDS DONT CHANGE UUNLESS READ THE FULL CODE
#for i in range(100):
# countalot+=1
# myhive=hivemind(r,lockpick,START,END,update,start=1,accuracy=ACCURACY,csvloci=csvloci)
# myhive.multitest(r2,str("Random Test "+str(datetime.datetime.now())+" (1 in 5 chosen to test) Epoch: " + str(countalot)))
#print((datetime.datetime.now()-NOW))
| python |
<gh_stars>1-10
package com.katacoda.solver.subcommands;
import com.katacoda.solver.models.Configuration;
import com.katacoda.solver.models.Hints;
import com.katacoda.solver.models.Verifications;
import org.jboss.logging.Logger;
import picocli.CommandLine.Command;
import picocli.CommandLine.Model.CommandSpec;
import picocli.CommandLine.Parameters;
import picocli.CommandLine.Spec;
import java.io.PrintWriter;
import java.util.concurrent.Callable;
@Command(name = "request_hint", hidden = true, description = "Request hint for task an verification number. Called by challenge framework, not by people.")
public class SubcommandRequestHint implements Callable<Integer> {
private static final Logger LOG = Logger.getLogger(SubcommandRequestHint.class);
@Spec
CommandSpec spec;
@Parameters(index = "0", defaultValue = "0", description = "Seconds since task prompted. (currently ignored)")
private int stepUptime = 0;
@Parameters(index = "1", defaultValue = "0", description = "Display hint for task.")
private int task = 0;
@Parameters(index = "2", defaultValue = "0", description = "Hint number of task to show")
private int hint = 0;
@Override
public Integer call() {
// TODO consider stepUptime with delay
Hints hints = new Hints();
if (task == 0) {
task = Configuration.getCurrentTask();
}
if (hint == 0) {
new Verifications().verify(task);
}
LOG.info(String.format("Getting hint for task %d, verification %d.", task, hint));
out().printf(hints.getHint(task, hint));
return 0;
}
private PrintWriter out() {
return spec.commandLine().getOut();
}
}
| java |
The Kasba Peth election in Pune has been made highly prestigious by all political parties. Moreover, the polling day also saw chaos in many places. Congress candidate Ravindra Dhangekar had called for a hunger strike, alleging the distribution of money. So a case was registered against them. A case has been registered against Dhangekar again today.
A case has been registered with the police directly based on the flex shared by Ravindra Dhangekar. Dhangekar's victory flexes were put up in the Wadgaon area of Pune just before the Kasba assembly by-election results. The police have now registered a case against two persons in this regard after the sky sign department of the Pune Municipal Corporation lodged a complaint against it. | english |
<reponame>jklin12/E-Learning
/**
* Icons are from http://icomoon.io/app/
**/
.fm-container * {
font-family: Lucida Sans Unicode, Lucida Grande, sans-serif;
box-sizing: content-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: content-box;
}
.fm-container {
padding: 10px;
background-color: #ffffff;
overflow: hidden; /** prevent overflow if #uploader h1 path value is too long */
}
.fm-container .fm-header {
display: block;
text-align: right;
height: auto;
min-height: 30px;
overflow: hidden;
}
.fm-container .fm-header .current-path > h1 {
display: block;
float: left;
margin:0.2em 0 0 1em;
line-height:1.9em;
font-size: 0.8em;
word-break: break-all;
}
.fm-container .fm-header .buttons-panel {
float: right;
margin-bottom: 0.5em;
}
.fm-container .fm-header .button-group {
display: inline-block;
margin: 0;
padding: 0;
}
.fm-container .fm-header .button-group button {
cursor: pointer;
padding: 2px 3px;
margin: 0 1px;
}
.fm-container .fm-header .button-group button.separator {
width: 2px;
padding-left: 0;
padding-right: 0;
margin: 1px 5px 0;
border: none;
cursor: default;
}
.fm-container button {
display: inline-block;
color: #777777;
background-color: #ffffff;
border: 1px solid #dcdcdc;
padding: 0.1em 0.3em;
text-decoration: none;
margin: 0 0.2em 0.5em 0.2em;
line-height: 1.7em;
cursor: pointer;
}
.fm-container button:hover {
background-color: #ffffff;
}
.fm-container .fm-header button span,
.fm-container .fm-fileinfo button span {
display: block;
padding-left: 20px;
background-position: left center;
background-repeat: no-repeat;
background-color: transparent;
white-space: nowrap;
}
.fm-container button:active,
.fm-container button:focus {
color:#000;
outline-color: transparent;
outline-style: none;
outline-width: 0;
}
.fm-container .fm-header button.no-label span {
background-position: center center;
}
.fm-container .fm-header button.active {
background: none repeat scroll 0 0 #F9F8F7;
border-style: inset;
}
.fm-container .fm-header .fm-btn-home span {
background-image: url(../images/house.png);
}
.fm-container .fm-header .fm-btn-level-up span {
background-image: url(../images/level-up.png);
}
.fm-container .fm-header .fm-btn-grid span {
background-image: url(../images/application_view_icons.png);
}
.fm-container .fm-header .fm-btn-list span {
background-image: url(../images/application_view_list.png);
}
.fm-container .fm-header .fm-btn-create-folder span {
background-image: url(../images/folder_add.png);
}
.fm-container .fm-splitter {
height: 400px;
/* no padding allowed */
}
.fm-container .fm-splitter .splitter-bar-vertical {
width: 6px;
background: url(../images/vgrabber.gif) no-repeat center;
}
.fm-container .fm-splitter > * {
/* to override height defined by splitter */
height: 100% !important;
}
.fm-container .fm-filetree {
overflow-y: auto;
overflow-x: auto;
color: #333;
margin: 0;
padding: 5px 0 0 5px;
}
.fm-container .fm-filetree li {
padding: 0;
margin: 0;
font-size: 0;
list-style: none;
line-height: 14px;
text-align: left;
white-space: nowrap;
outline: 0
}
.fm-container .fm-filetree li ul {
margin: 0;
padding: 0 0 0 18px
}
.fm-container .fm-filetree li ul.line {
background: url(../images/filetree/line_conn.gif) 0 0 repeat-y;
}
.fm-container .fm-filetree li a {
font-size: 12px;
padding: 1px 3px 0 0;
margin: 0;
cursor: pointer;
height: 17px;
background-color: transparent;
text-decoration: none;
vertical-align: top;
display: inline-block
}
.fm-container .fm-filetree li a:hover {
background-color: #55767F;
text-decoration: none
}
.fm-container .fm-filetree li a.curSelectedNode {
padding-top: 0;
background-color: #FFE6B0;
color: black;
height: 16px;
border: 1px #FFB951 solid;
opacity: 0.8;
}
.fm-container .fm-filetree li a.drop-hover {
padding-top: 0;
background-color: #316AC5;
color: white;
height: 16px;
border: 1px #316AC5 solid;
opacity: 0.8;
filter: alpha(opacity=80)
}
.fm-container .fm-filetree li span {
line-height: 16px;
}
.fm-container .fm-filetree li span.button {
line-height: 0;
margin: 0;
width: 16px;
height: 16px;
display: inline-block;
vertical-align: middle;
border: 0 none;
cursor: pointer;
outline: none;
background-color: transparent;
background-repeat: no-repeat;
background-attachment: scroll;
background-image: url("../images/filetree/preset.png");
*background-image: url("../images/filetree/preset.gif")
}
.fm-container .fm-filetree li span.button.switch {
width: 18px;
height: 18px;
}
.fm-container .fm-filetree li span.button.root_open {background-position: -92px -54px;}
.fm-container .fm-filetree li span.button.root_close {background-position: -74px -54px;}
.fm-container .fm-filetree li span.button.roots_open {background-position: -92px 0;}
.fm-container .fm-filetree li span.button.roots_close {background-position: -74px 0;}
.fm-container .fm-filetree li span.button.center_open {background-position: -92px -18px;}
.fm-container .fm-filetree li span.button.center_close {background-position: -74px -18px;}
.fm-container .fm-filetree li span.button.bottom_open {background-position: -92px -36px;}
.fm-container .fm-filetree li span.button.bottom_close {background-position: -74px -36px;}
.fm-container .fm-filetree li span.button.noline_open {background-position: -92px -72px;}
.fm-container .fm-filetree li span.button.noline_close {background-position: -74px -72px;}
.fm-container .fm-filetree li span.button.root_docu {background: none;}
.fm-container .fm-filetree li span.button.roots_docu {background-position: -56px 0;}
.fm-container .fm-filetree li span.button.center_docu {background-position: -56px -18px;}
.fm-container .fm-filetree li span.button.bottom_docu {background-position: -56px -36px;}
.fm-container .fm-filetree li span.button.noline_docu {background: none;}
.fm-container .fm-fileinfo {
overflow-y: auto;
overflow-x: hidden;
box-sizing: border-box;
border: 1px solid #dcdcdc;
text-align: center;
color: #333;
padding: 0;
margin: 0;
}
.fm-container .fm-fileinfo * {
font-size: 12px;
}
.fm-container .fm-fileinfo .fm-loading-view {
width: 30px;
height: 30px;
margin: 100px auto 0;
background: url(../images/spinner.gif) no-repeat center center;
}
.fm-container .fm-fileinfo #main-title {
margin: 10px auto;
}
.fm-container .fm-fileinfo h1 {
font-size: 20px;
display: inline-block;
color: #8fabc6;
}
.fm-container .fm-fileinfo > h1 {
margin-top: 3em
}
.fm-container div#tools {
display: inline-block;
margin-left: 1em;
}
.fm-container .fm-preview {
width: 100%;
}
.fm-container .fm-preview .fm-preview-viewer {
margin: 25px;
}
.fm-container .fm-preview .fm-preview-viewer img {
max-width: 80%;
}
.fm-container .fm-preview .fm-preview-details {
width: 400px;
margin: 20px auto;
}
.fm-container .fm-preview .fm-preview-details table {
width: 100%
}
.fm-container .fm-preview .fm-preview-details td {
width: 50%;
padding: 4px;
text-align: left;
border-bottom: 1px dotted #ccc;
}
.fm-container .fm-preview .fm-preview-details td:nth-child(2) {
font-weight: bold;
}
.fm-container .fm-preview .fm-preview-toolbar {
margin-top: 30px;
}
.fm-container .fm-preview .fm-preview-toolbar button {
cursor: pointer;
}
/** Input file Replacement */
.fm-container input,
.fm-container button {
vertical-align: text-top;
}
.fm-container #file-input-container {
display: inline;
margin: 0;
position: relative;
top: 0;
width: 255px;
height: 32px;
overflow: hidden;
}
.fm-container #newfile {
position: absolute;
top: 0;
right: 0;
height: 28px;
width: 100%;
opacity: 0;
filter: alpha(opacity=0);
cursor: pointer;
border: 1px solid blue;
}
.fm-container .hidden-file-input {
display: inline-block;
overflow: hidden;
visibility: hidden;
width: 1px;
z-index:-1;
}
.fm-container #alt-fileinput {
display: inline;
}
.fm-container #filepath {
margin: 0;
padding: 0 5px;
line-height: 26px;
background-color: #F4F1ED;
border: 1px solid #dcdcdc;
}
.fm-container button#browse {
margin-left:0;
-webkit-border-top-left-radius: 0;
-webkit-border-bottom-left-radius: 0;
-moz-border-radius-topleft: 0;
-moz-border-radius-bottomleft: 0;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
min-height: 16px;
min-width: 40px;
}
.fm-container button#browse span {
margin:0;
padding:0;
background: url(../images/plus.png) no-repeat center center;
display: block;
color:#666;
text-shadow: none;
}
/** Input file Replacement - end */
.fm-container .fm-footer .right {
float: right;
}
.fm-container .fm-footer .left {
float: left;
}
.fm-container #folder-info {
display: inline-block;
}
.fm-container #folder-info {
font-size: 0.8em;
color: #777;
padding: 1.3em 0.5em 0 1.3em;
}
.fm-container #summary {
width: 16px;
height: 16px;
display: inline-block;
background: url(../images/summary.png) no-repeat center center;
cursor: pointer;
}
.fm-container #link-to-project {
height: 12px;
width: 45px;
display: inline-block;
background: transparent url(../images/fmlogo.png) no-repeat 0 0;
margin: 1em 1em 0 1em;
}
.fm-container .search-box {
position: absolute;
}
.fm-container .search-box input {
background-color: #ffffff;
border: 1px solid #dcdcdc;
margin: 0.5em 0 0;
padding: 0.1em 0.3em;
line-height: 1.7em;
width: 200px;
}
.fm-container .search-box input:focus {
background-color: #ffffff;
}
.fm-container .search-box .search-box-reset {
position: absolute;
width: 16px;
height: 16px;
background: url(../images/reset.png) no-repeat center center;
opacity: 0.5;
right: 6px;
top: 12px;
cursor: pointer;
}
/* to expand selectable area to 100% vertically */
.fm-container .fm-fileinfo .mCSB_container.mCS_no_scrollbar_y {
height: 100%;
}
.fm-container .view-items {
height: 100%;
}
.fm-container .view-items .grid {
padding: 15px;
text-align: left;
}
.fm-container .view-items .grid li {
display: inline-block;
width: 142px;
height: 142px;
text-align: center;
overflow: hidden;
margin: 10px;
border: 1px solid white;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.fm-container .view-items .grid li:hover {
cursor: pointer;
}
.fm-container .view-items .grid li:hover:not(.ui-selected) {
border: 1px solid #E5E5E5;
background-color: #F7F7F7;
}
.fm-container .view-items .grid .item-content {
height: 100%;
overflow: hidden;
}
.fm-container .view-items .grid .item-content .clip {
width: 64px;
height: 64px;
margin: 10px auto;
overflow: hidden;
}
.fm-container .view-items .grid li.drop-hover,
.fm-container .view-items .list tr.drop-hover {
background-color: #e0e0e0;
}
.fm-container .view-items .list tbody tr:hover {
cursor: pointer;
}
.fm-container .view-items .list tbody tr:hover:not(.ui-selected) {
background-color: #eee;
}
.fm-container .view-items .grid p {
display: block;
text-align: center;
margin-bottom: 10px;
white-space: nowrap;
}
.fm-container .view-items .list {
width: 100%;
}
.fm-container .view-items .list th {
padding: 6px;
text-align: center;
white-space: nowrap;
}
.fm-container .view-items .list thead {
background: rgb(244,241,237); /* Old browsers */
background: -moz-linear-gradient(top, rgba(244,241,237,1) 0%, rgba(214,212,209,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(244,241,237,1)), color-stop(100%,rgba(214,212,209,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(244,241,237,1) 0%,rgba(214,212,209,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(244,241,237,1) 0%,rgba(214,212,209,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(244,241,237,1) 0%,rgba(214,212,209,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(244,241,237,1) 0%,rgba(214,212,209,1) 100%); /* W3C */
border-bottom: 1px solid #ccc;
}
.fm-container .view-items .list th {
font-weight: bold;
cursor: pointer;
}
.fm-container .view-items .list th.sorted-asc,
.fm-container .view-items .list th.sorted-desc {
background: rgb(214,212,209); /* Old browsers */
background: -moz-linear-gradient(top, rgba(214,212,209,1) 0%, rgba(244,241,237,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(214,212,209,1)), color-stop(100%,rgba(244,241,237,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(214,212,209,1) 0%,rgba(244,241,237,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(214,212,209,1) 0%,rgba(244,241,237,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(214,212,209,1) 0%,rgba(244,241,237,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(214,212,209,1) 0%,rgba(244,241,237,1) 100%); /* W3C */
}
.fm-container .view-items .list th.sorted-asc span {
display: block;
width: 100%;
margin-right: 20px;
background-image: url(../images/bullet_arrow_up.png);
background-repeat: no-repeat;
background-position: right center;
}
.fm-container .view-items .list th.sorted-desc span {
display: block;
width: 100%;
margin-right: 20px;
background-image: url(../images/bullet_arrow_down.png);
background-repeat: no-repeat;
background-position: right center;
}
.fm-container .view-items .list td {
padding: 4px;
text-align: left;
white-space: nowrap;
vertical-align: middle;
border-bottom: 1px dotted #ccc;
}
.fm-container .view-items .list td:first-child {
width: 100%;
}
.fm-container .view-items .list .list-icon {
display: inline-block;
width: 16px;
height: 16px;
vertical-align: middle;
background-repeat: no-repeat;
background-position: center;
}
.fm-container .context-menu-list {
min-width: 150px;
background-color:#F4F1ED;
}
.fm-container .context-menu-item {
font-size: 11px;
margin: 2px 0;
background-color: #F4F1ED;
}
.fm-container .context-menu-item:before {
content: " ";
position: absolute;
width: 16px;
height: 16px;
left: 6px;
top: 0;
}
.fm-container .context-menu-item.context-menu-hover {
background-color: #BDF;
}
.fm-container .context-menu-item.context-menu-disabled {
opacity: 0.6;
color: inherit;
background-color: inherit;
}
/* these apply to the context menus as well as the buttons */
.fm-container #select span,
.fm-container .context-menu-item.select:before { background-image: url(../images/accept.png); }
.fm-container #download span,
.fm-container .context-menu-item.download:before { background-image: url(../images/download.png); }
.fm-container #rename span,
.fm-container .context-menu-item.rename:before { background-image: url(../images/tag.png); }
.fm-container #move span,
.fm-container .context-menu-item.move:before { background-image: url(../images/move.png); }
.fm-container #replace span,
.fm-container .context-menu-item.replace:before { background-image: url(../images/replace.png); }
.fm-container #delete span,
.fm-container .context-menu-item.delete:before { background-image: url(../images/bin_closed.png); }
.fm-container .context-menu-item.create-folder:before { background-image: url(../images/folder_add.png); }
.fm-container #clipboard-cut span,
.fm-container .context-menu-item.cut:before { background-image: url(../images/clipboard/clipboard_cut.png); background-position: center; }
.fm-container #clipboard-copy span,
.fm-container .context-menu-item.copy:before { background-image: url(../images/clipboard/clipboard_copy.png); background-position: center; }
.fm-container #clipboard-paste span,
.fm-container .context-menu-item.paste:before { background-image: url(../images/clipboard/clipboard_paste.png); background-position: center; }
.fm-container #clipboard-clear span { background-image: url(../images/clipboard/clipboard_clear.png); background-position: center; }
.fm-container .fm-upload span { background-image: url(../images/upload.png); }
.fm-container .fm-upload.loading span { background-image: url(../images/ajax-loader.gif);color:#555555;font-size:0.9em; }
.fm-container #parentfolder span { background-image: url(../images/parentfolder.png); }
.fm-container .fm-preview .fm-btn-edit-file {
display: inline-block;
background: url(../images/edit.png) no-repeat center center;
width: 20px;
height: 18px;
margin: 0 0.2em;
}
.fm-container .fm-preview .fm-btn-clipboard {
display: inline-block;
background: url(../images/copy.png) no-repeat center center;
width: 20px;
height: 18px;
margin: 0 0.2em;
}
.fm-container .fm-preview .fm-preview-editor button {
color: black;
}
.fm-container .fm-preview .fm-preview-editor div.CodeMirror {
text-align: left;
width: 70%;
border: 1px solid #eee;
height: auto;
margin: 2em auto;
}
.fm-container .fm-preview .fm-preview-editor div.CodeMirror * {
font-family: monospace;
line-height: 15px;
}
.fm-container .fm-preview div.CodeMirror.CodeMirror-fullscreen {
width: 100%;
margin: 0;
z-index: 9;
}
/* IE10-11 styles */
html[data-useragent*='MSIE 10.0'] .fm-container .fm-header button,
html[data-useragent*='MSIE 11.0'] .fm-container .fm-header button {
vertical-align: top;
}
html[data-useragent*='MSIE 10.0'] .fm-container #file-input-container,
html[data-useragent*='MSIE 11.0'] .fm-container #file-input-container {
width: 220px;
height: 32px;
overflow: hidden;
}
html[data-useragent*='MSIE 10.0'] .fm-container #filepath,
html[data-useragent*='MSIE 11.0'] .fm-container #filepath {
height: 22px;
}
html[data-useragent*='MSIE 10.0'] .fm-container #newfile,
html[data-useragent*='MSIE 11.0'] .fm-container #newfile {
height: 23px;
}
/** Drag & Drop **/
.fm-container .drag-helper-list {
white-space: nowrap;
}
.fm-container .drag-helper-list .list-icon {
display: inline-block;
width: 16px;
height: 16px;
vertical-align: middle;
background-repeat: no-repeat;
background-position: center;
}
.fm-container .drag-helper-grid {
display: inline-block;
width: 142px;
height: 142px;
text-align: center;
overflow: hidden;
margin: 10px;
border: 1px solid white;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
.fm-container .drag-helper-grid .clip {
width: 64px;
height: 64px;
margin: 10px auto;
overflow: hidden;
}
.fm-container .drag-helper-grid .item-content {
height: 100%;
overflow: hidden;
z-index: 1;
opacity: 0.7;
}
.fm-container .drag-helper-grid .item-background {
position: absolute;
width: 100%;
height: 100%;
background-color: #B6CDEC;
opacity: 0.5;
z-index: 1;
}
.fm-container .drag-helper-grid .dragging-counter {
position: absolute;
top: 35px;
width: 100%;
text-align: center;
z-index: 2;
}
.fm-container .drag-helper-grid .dragging-counter span {
display: inline-block;
margin-left: 10px;
padding: 0.2em 0.4em;
background-color: #4e68e7;
border: 1px solid #FFF;
border-radius: 5px;
font-size: 15px !important;
color: #FFF;
}
.fm-container .drag-helper-grid .dragging-stop {
display: none;
position: absolute;
bottom: 10px;
width: 100%;
margin: 0;
z-index: 2;
}
.fm-container .drag-helper-grid .dragging-stop .cancel-image {
width: 25px;
height: 25px;
margin: 0 auto;
background: url(../images/fileicons/drag-n-drop/cancel-5.png) center center no-repeat;
background-size: cover;
}
.fm-container .drag-helper-grid.drop-restricted .dragging-stop {
display: block;
}
.fm-container .drag-helper-list .list-line {
display: inline-block;
text-align: left;
white-space: nowrap;
}
/** Selectable items **/
.fm-container .ui-selectable-helper {
position: absolute;
border: 1px dotted black;
z-index: 100;
}
.fm-container .view-items .ui-selecting {
background-color: #CED9E9;
}
.fm-container .view-items .ui-selected {
background-color: #CED9E9;
}
/** Modal dialog by Alertify plugin */
.fm-popup.alertify,
.fm-log.alertify-logs {
font-family: Oxygen, Lucida Sans Unicode, Lucida Grande, sans-serif;
}
.fm-log.alertify-logs {
position: absolute;
font-size: 13px;
line-height: 13px;
}
.fm-popup.alertify .alert,
.fm-popup.alertify .dialog {
text-align: center;
font-size: 12px;
}
.fm-popup.alertify .alert>*,
.fm-popup.alertify .dialog>* {
width: auto;
display: inline-block;
}
.fm-popup.alertify .alert [data-alertify-btn-holder] [data-alertify-btn]:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button),
.fm-popup.alertify .dialog [data-alertify-btn-holder] [data-alertify-btn]:not(.btn):not(.pure-button):not(.md-button):not(.mdl-button) {
font-size: 13px;
line-height: 32px;
min-height: 32px;
}
.fm-popup.alertify div.prompt-info {
line-height: 12px;
min-height: 15px;
margin-top: 5px;
padding-left: 25px;
color: #444;
background: transparent url(../images/info.png) no-repeat 0 0;
background-position: left center;
}
.fm-popup.alertify .fm-fileupload-container {
width: auto;
min-width: 200px;
max-width: 825px;
}
.fm-popup.alertify .fm-fileupload-container h2 {
font-size: 1.2em;
font-weight: bold;
}
.fm-popup.alertify .fm-fileupload-container #total-progress {
width: 100%;
height: 5px;
margin-bottom: 10px;
background-color: #A7A1C6;
overflow: hidden;
}
.fm-popup.alertify .fm-fileupload-container #total-progress .progress-bar {
height: 5px;
background-color: #294750;
}
.fm-popup.alertify #summary-popup {
font-size: 1.2em;
}
.fm-popup.alertify #summary-popup .title {
font-weight: bold;
margin-bottom: 0.8em;
}
.fm-popup.alertify #summary-popup .line {
line-height: 1.4em;
}
#fm-js-btn-close {
margin-top: 5px;
display: block;
/*width: 100%;*/
font-variant: small-caps;
padding: 0.5em;
margin-left: 10px;
}
/** ICONS - List view and File tree related styles **/
.fm-fileinfo .list-icon.ico_folder,
.fm-filetree li span.button.ico_folder {
background: url(../images/filetree/ico_folder.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_folder_lock,
.fm-filetree li span.button.ico_folder_lock {
background: url(../images/filetree/ico_folder_lock.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_folder_open,
.fm-filetree li span.button.ico_folder_open {
background: url(../images/filetree/ico_folder_open.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_file,
.fm-filetree li span.button.ico_file {
background: url(../images/filetree/ico_file.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_file_lock,
.fm-filetree li span.button.ico_file_lock {
background: url(../images/filetree/ico_file_lock.png) left top no-repeat !important;
}
.fm-fileinfo .list-icon.ico_loading,
.fm-filetree li span.button.ico_loading {
background: url(../images/filetree/loading.gif) left top no-repeat;
}
/** ICONS - List view and File tree related styles based on file extension **/
.fm-fileinfo .list-icon.ico_ext_3g2,
.fm-filetree li span.button.ico_ext_3g2 {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_3gp,
.fm-filetree li span.button.ico_ext_3gp {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_7z,
.fm-filetree li span.button.ico_ext_7z {
background: url(../images/filetree/ico_zip.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_afp,
.fm-filetree li span.button.ico_ext_afp {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_afpa,
.fm-filetree li span.button.ico_ext_afpa {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_asp,
.fm-filetree li span.button.ico_ext_asp {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_aspx,
.fm-filetree li span.button.ico_ext_aspx {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_avi,
.fm-filetree li span.button.ico_ext_avi {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_bat,
.fm-filetree li span.button.ico_ext_bat {
background: url(../images/filetree/ico_application.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_bmp,
.fm-filetree li span.button.ico_ext_bmp {
background: url(../images/filetree/ico_picture.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_c,
.fm-filetree li span.button.ico_ext_c {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_cfm,
.fm-filetree li span.button.ico_ext_cfm {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_cgi,
.fm-filetree li span.button.ico_ext_cgi {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_com,
.fm-filetree li span.button.ico_ext_com {
background: url(../images/filetree/ico_application.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_cpp,
.fm-filetree li span.button.ico_ext_cpp {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_css,
.fm-filetree li span.button.ico_ext_css {
background: url(../images/filetree/ico_css.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_csv,
.fm-filetree li span.button.ico_ext_csv {
background: url(../images/filetree/ico_txt.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_doc,
.fm-filetree li span.button.ico_ext_doc {
background: url(../images/filetree/ico_doc.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_docx,
.fm-filetree li span.button.ico_ext_docx {
background: url(../images/filetree/ico_doc.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_exe,
.fm-filetree li span.button.ico_ext_exe {
background: url(../images/filetree/ico_application.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_gif,
.fm-filetree li span.button.ico_ext_gif {
background: url(../images/filetree/ico_picture.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_f4v,
.fm-filetree li span.button.ico_ext_f4v {
background: url(../images/filetree/ico_flash.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_fla,
.fm-filetree li span.button.ico_ext_fla {
background: url(../images/filetree/ico_flash.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_flv,
.fm-filetree li span.button.ico_ext_flv {
background: url(../images/filetree/ico_flash.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_h,
.fm-filetree li span.button.ico_ext_h {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_htm,
.fm-filetree li span.button.ico_ext_htm {
background: url(../images/filetree/ico_html.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_html,
.fm-filetree li span.button.ico_ext_html {
background: url(../images/filetree/ico_html.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_jar,
.fm-filetree li span.button.ico_ext_jar {
background: url(../images/filetree/ico_java.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_jpg,
.fm-filetree li span.button.ico_ext_jpg {
background: url(../images/filetree/ico_picture.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_jpeg,
.fm-filetree li span.button.ico_ext_jpeg {
background: url(../images/filetree/ico_picture.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_js,
.fm-filetree li span.button.ico_ext_js {
background: url(../images/filetree/ico_script.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_lasso,
.fm-filetree li span.button.ico_ext_lasso {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_log,
.fm-filetree li span.button.ico_ext_log {
background: url(../images/filetree/ico_txt.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_m4p,
.fm-filetree li span.button.ico_ext_m4p {
background: url(../images/filetree/ico_music.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_m4v,
.fm-filetree li span.button.ico_ext_m4v {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_mov,
.fm-filetree li span.button.ico_ext_mov {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_mp3,
.fm-filetree li span.button.ico_ext_mp3 {
background: url(../images/filetree/ico_music.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_mp4,
.fm-filetree li span.button.ico_ext_mp4 {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_mpg,
.fm-filetree li span.button.ico_ext_mpg {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_mpeg,
.fm-filetree li span.button.ico_ext_mpeg {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_odp,
.fm-filetree li span.button.ico_ext_odp {
background: url(../images/filetree/ico_ppt.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_ods,
.fm-filetree li span.button.ico_ext_ods {
background: url(../images/filetree/ico_xls.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_odt,
.fm-filetree li span.button.ico_ext_odt {
background: url(../images/filetree/ico_doc.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_ogv,
.fm-filetree li span.button.ico_ext_ogv {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_ogg,
.fm-filetree li span.button.ico_ext_ogg {
background: url(../images/filetree/ico_music.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_pcx,
.fm-filetree li span.button.ico_ext_pcx {
background: url(../images/filetree/ico_picture.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_pdf,
.fm-filetree li span.button.ico_ext_pdf {
background: url(../images/filetree/ico_pdf.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_php,
.fm-filetree li span.button.ico_ext_php {
background: url(../images/filetree/ico_php.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_png,
.fm-filetree li span.button.ico_ext_png {
background: url(../images/filetree/ico_picture.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_ppt,
.fm-filetree li span.button.ico_ext_ppt {
background: url(../images/filetree/ico_ppt.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_pptx,
.fm-filetree li span.button.ico_ext_pptx {
background: url(../images/filetree/ico_ppt.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_psd,
.fm-filetree li span.button.ico_ext_psd {
background: url(../images/filetree/ico_psd.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_pl,
.fm-filetree li span.button.ico_ext_pl {
background: url(../images/filetree/ico_script.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_py,
.fm-filetree li span.button.ico_ext_py {
background: url(../images/filetree/ico_script.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_rar,
.fm-filetree li span.button.ico_ext_rar {
background: url(../images/filetree/ico_zip.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_rb,
.fm-filetree li span.button.ico_ext_rb {
background: url(../images/filetree/ico_ruby.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_rbx,
.fm-filetree li span.button.ico_ext_rbx {
background: url(../images/filetree/ico_ruby.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_rhtml,
.fm-filetree li span.button.ico_ext_rhtml {
background: url(../images/filetree/ico_ruby.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_rpm,
.fm-filetree li span.button.ico_ext_rpm {
background: url(../images/filetree/ico_linux.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_ruby,
.fm-filetree li span.button.ico_ext_ruby {
background: url(../images/filetree/ico_ruby.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_sql,
.fm-filetree li span.button.ico_ext_sql {
background: url(../images/filetree/ico_db.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_swf,
.fm-filetree li span.button.ico_ext_swf {
background: url(../images/filetree/ico_flash.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_tar,
.fm-filetree li span.button.ico_ext_tar {
background: url(../images/filetree/ico_zip.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_tif,
.fm-filetree li span.button.ico_ext_tif {
background: url(../images/filetree/ico_picture.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_tiff,
.fm-filetree li span.button.ico_ext_tiff {
background: url(../images/filetree/ico_picture.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_txt,
.fm-filetree li span.button.ico_ext_txt {
background: url(../images/filetree/ico_txt.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_vb,
.fm-filetree li span.button.ico_ext_vb {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_wav,
.fm-filetree li span.button.ico_ext_wav {
background: url(../images/filetree/ico_music.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_weba,
.fm-filetree li span.button.ico_ext_weba {
background: url(../images/filetree/ico_music.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_webm,
.fm-filetree li span.button.ico_ext_webm {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_wmv,
.fm-filetree li span.button.ico_ext_wmv {
background: url(../images/filetree/ico_film.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_xls,
.fm-filetree li span.button.ico_ext_xls {
background: url(../images/filetree/ico_xls.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_xlsx,
.fm-filetree li span.button.ico_ext_xlsx {
background: url(../images/filetree/ico_xls.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_xml,
.fm-filetree li span.button.ico_ext_xml {
background: url(../images/filetree/ico_code.png) left top no-repeat;
}
.fm-fileinfo .list-icon.ico_ext_zip,
.fm-filetree li span.button.ico_ext_zip {
background: url(../images/filetree/ico_zip.png) left top no-repeat;
}
/** ICONS - Grid view related styles **/
.fm-fileinfo .grid-icon {
display: block;
margin: 0 auto;
overflow: hidden;
text-indent: -200%;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
}
.fm-fileinfo .grid-icon {
width: 64px;
height: 64px;
}
.fm-fileinfo .fm-preview .grid-icon {
width: 128px;
height: 128px;
}
.fm-fileinfo .grid-icon.ico_file {
background-image: url(../images/fileicons/icon_file.png);
}
.fm-fileinfo .grid-icon.ico_file_lock {
background-image: url(../images/fileicons/icon_file_lock.png);
}
.fm-fileinfo .grid-icon.ico_folder {
background-image: url(../images/fileicons/icon_folder.png);
}
.fm-fileinfo .grid-icon.ico_folder_lock {
background-image: url(../images/fileicons/icon_folder_lock.png);
}
.fm-fileinfo .grid-icon.ico_folder_parent {
background-image: url(../images/fileicons/icon_folder_parent.png);
}
.fm-fileinfo .grid-icon.ico_multiple {
background-image: url(../images/fileicons/icon_multiple.png);
}
/** ICONS - Grid view related styles based on file extension **/
.fm-fileinfo .grid-icon.ico_ext_3g2 {
background-image: url(../images/fileicons/icon_movie.png);
}
.fm-fileinfo .grid-icon.ico_ext_3gp {
background-image: url(../images/fileicons/icon_movie.png);
}
.fm-fileinfo .grid-icon.ico_ext_7z {
background-image: url(../images/fileicons/icon_zip.png);
}
.fm-fileinfo .grid-icon.ico_ext_aac {
background-image: url(../images/fileicons/icon_aac.png);
}
.fm-fileinfo .grid-icon.ico_ext_avi {
background-image: url(../images/fileicons/icon_avi.png);
}
.fm-fileinfo .grid-icon.ico_ext_bmp {
background-image: url(../images/fileicons/icon_bmp.png);
}
.fm-fileinfo .grid-icon.ico_ext_chm {
background-image: url(../images/fileicons/icon_chm.png);
}
.fm-fileinfo .grid-icon.ico_ext_css {
background-image: url(../images/fileicons/icon_css.png);
}
.fm-fileinfo .grid-icon.ico_ext_csv {
background-image: url(../images/fileicons/icon_txt.png);
}
.fm-fileinfo .grid-icon.ico_ext_dll {
background-image: url(../images/fileicons/icon_dll.png);
}
.fm-fileinfo .grid-icon.ico_ext_doc,
.fm-fileinfo .grid-icon.ico_ext_docx {
background-image: url(../images/fileicons/icon_doc.png);
}
.fm-fileinfo .grid-icon.ico_ext_fla {
background-image: url(../images/fileicons/icon_fla.png);
}
.fm-fileinfo .grid-icon.ico_ext_gif {
background-image: url(../images/fileicons/icon_gif.png);
}
.fm-fileinfo .grid-icon.ico_ext_htm,
.fm-fileinfo .grid-icon.ico_ext_html {
background-image: url(../images/fileicons/icon_html.png);
}
.fm-fileinfo .grid-icon.ico_ext_ini {
background-image: url(../images/fileicons/icon_ini.png);
}
.fm-fileinfo .grid-icon.ico_ext_jar {
background-image: url(../images/fileicons/icon_jar.png);
}
.fm-fileinfo .grid-icon.ico_ext_jpg,
.fm-fileinfo .grid-icon.ico_ext_jpeg {
background-image: url(../images/fileicons/icon_jpg.png);
}
.fm-fileinfo .grid-icon.ico_ext_js {
background-image: url(../images/fileicons/icon_js.png);
}
.fm-fileinfo .grid-icon.ico_ext_lasso {
background-image: url(../images/fileicons/icon_lasso.png);
}
.fm-fileinfo .grid-icon.ico_ext_m4p {
background-image: url(../images/fileicons/icon_music.png);
}
.fm-fileinfo .grid-icon.ico_ext_m4v {
background-image: url(../images/fileicons/icon_movie.png);
}
.fm-fileinfo .grid-icon.ico_ext_mdb {
background-image: url(../images/fileicons/icon_mdb.png);
}
.fm-fileinfo .grid-icon.ico_ext_mov {
background-image: url(../images/fileicons/icon_mov.png);
}
.fm-fileinfo .grid-icon.ico_ext_mp3 {
background-image: url(../images/fileicons/icon_mp3.png);
}
.fm-fileinfo .grid-icon.ico_ext_mp4 {
background-image: url(../images/fileicons/icon_movie.png);
}
.fm-fileinfo .grid-icon.ico_ext_mpg {
background-image: url(../images/fileicons/icon_mpg.png);
}
.fm-fileinfo .grid-icon.ico_ext_mpeg {
background-image: url(../images/fileicons/icon_movie.png);
}
.fm-fileinfo .grid-icon.ico_ext_odp {
background-image: url(../images/fileicons/icon_odp.png);
}
.fm-fileinfo .grid-icon.ico_ext_ods {
background-image: url(../images/fileicons/icon_ods.png);
}
.fm-fileinfo .grid-icon.ico_ext_odt {
background-image: url(../images/fileicons/icon_odt.png);
}
.fm-fileinfo .grid-icon.ico_ext_ogg {
background-image: url(../images/fileicons/icon_music.png);
}
.fm-fileinfo .grid-icon.ico_ext_pcx {
background-image: url(../images/fileicons/icon_image.png);
}
.fm-fileinfo .grid-icon.ico_ext_ogv {
background-image: url(../images/fileicons/icon_movie.png);
}
.fm-fileinfo .grid-icon.ico_ext_pdf {
background-image: url(../images/fileicons/icon_pdf.png);
}
.fm-fileinfo .grid-icon.ico_ext_php {
background-image: url(../images/fileicons/icon_php.png);
}
.fm-fileinfo .grid-icon.ico_ext_png {
background-image: url(../images/fileicons/icon_png.png);
}
.fm-fileinfo .grid-icon.ico_ext_ppt,
.fm-fileinfo .grid-icon.ico_ext_pptx {
background-image: url(../images/fileicons/icon_ppt.png);
}
.fm-fileinfo .grid-icon.ico_ext_py {
background-image: url(../images/fileicons/icon_py.png);
}
.fm-fileinfo .grid-icon.ico_ext_rar {
background-image: url(../images/fileicons/icon_zip.png);
}
.fm-fileinfo .grid-icon.ico_ext_rb {
background-image: url(../images/fileicons/icon_rb.png);
}
.fm-fileinfo .grid-icon.ico_ext_real {
background-image: url(../images/fileicons/icon_real.png);
}
.fm-fileinfo .grid-icon.ico_ext_reg {
background-image: url(../images/fileicons/icon_reg.png);
}
.fm-fileinfo .grid-icon.ico_ext_rtf {
background-image: url(../images/fileicons/icon_rtf.png);
}
.fm-fileinfo .grid-icon.ico_ext_sql {
background-image: url(../images/fileicons/icon_sql.png);
}
.fm-fileinfo .grid-icon.ico_ext_swf {
background-image: url(../images/fileicons/icon_swf.png);
}
.fm-fileinfo .grid-icon.ico_ext_tar {
background-image: url(../images/fileicons/icon_zip.png);
}
.fm-fileinfo .grid-icon.ico_ext_tif,
.fm-fileinfo .grid-icon.ico_ext_tiff {
background-image: url(../images/fileicons/icon_image.png);
}
.fm-fileinfo .grid-icon.ico_ext_txt {
background-image: url(../images/fileicons/icon_txt.png);
}
.fm-fileinfo .grid-icon.ico_ext_vbs {
background-image: url(../images/fileicons/icon_vbs.png);
}
.fm-fileinfo .grid-icon.ico_ext_wav {
background-image: url(../images/fileicons/icon_wav.png);
}
.fm-fileinfo .grid-icon.ico_ext_weba {
background-image: url(../images/fileicons/icon_music.png);
}
.fm-fileinfo .grid-icon.ico_ext_webm {
background-image: url(../images/fileicons/icon_movie.png);
}
.fm-fileinfo .grid-icon.ico_ext_wma {
background-image: url(../images/fileicons/icon_wma.png);
}
.fm-fileinfo .grid-icon.ico_ext_wmv {
background-image: url(../images/fileicons/icon_wmv.png);
}
.fm-fileinfo .grid-icon.ico_ext_xls,
.fm-fileinfo .grid-icon.ico_ext_xlsx {
background-image: url(../images/fileicons/icon_xls.png);
}
.fm-fileinfo .grid-icon.ico_ext_xml {
background-image: url(../images/fileicons/icon_xml.png);
}
.fm-fileinfo .grid-icon.ico_ext_xsl {
background-image: url(../images/fileicons/icon_xsl.png);
}
.fm-fileinfo .grid-icon.ico_ext_zip {
background-image: url(../images/fileicons/icon_zip.png);
}
| css |
<reponame>SohrabAmin/Free-Room
{"id": "WSTD03H3F20199", "code": "WSTD03H3F", "name": "Senior Seminar in Sex, Gender and the Body", "description": "An advanced and in-depth examination of selected topics related to health, sexualities, the gendered body, and the representations and constructions of women and gender. The course will be in a seminar format with student participation expected. It is writing intensive and involves a major research project.", "division": "University of Toronto Scarborough", "department": "Dept. of Historical & Cultural Studies (UTSC)", "prerequisites": "WSTA01H3 and [WSTA03H3 or (WSTA02H3)] and WSTB11H3 and [1.0 credit at the C-level from requirement 5 or 6 of the Major program in Women's and Gender Studies]", "exclusions": "", "level": 400, "campus": "UTSC", "term": "2019 Fall", "breadths": [], "meeting_sections": [{"code": "L01", "instructors": ["<NAME>"], "times": [{"day": "WEDNESDAY", "start": 46800, "end": 54000, "duration": 7200, "location": "MW 262"}], "size": 20, "enrolment": 0}]} | json |
<reponame>charles-halifax/recipes<filename>index/h/honey-nutty-granola.json
{
"directions": [
"Preheat oven to 300 degrees F (150 degrees C).",
"Combine oats, almonds, macadamia nuts, and coconut in a large bowl. Heat olive oil, honey, butter, and brown sugar together in a separate microwave-safe bowl in the microwave until butter is melted, 30 seconds to 1 minute.",
"Whisk butter mixture until brown sugar is dissolved; stir in salt, turmeric, and cinnamon. Pour butter mixture over oat mixture; toss to coat thoroughly. Spread granola evenly on a baking sheet.",
"Bake granola in preheated oven until well-toasted and golden brown, about 30 minutes. Cool on the baking sheet to set, about 15 minutes. Transfer to a large bowl; stir in raisins."
],
"ingredients": [
"3 cups rolled oats",
"1 1/2 cups toasted almonds, coarsely chopped",
"1 cup roasted macadamia nuts, coarsely chopped",
"1 1/2 cups flaked coconut",
"1/2 cup extra-virgin olive oil",
"3/4 cup honey",
"1/4 cup butter",
"1/2 cup brown sugar",
"1 teaspoon kosher salt",
"1/2 teaspoon ground turmeric",
"1/2 teaspoon ground cinnamon",
"3/4 cup golden raisins"
],
"language": "en-US",
"source": "allrecipes.com",
"tags": [],
"title": "Honey Nutty Granola",
"url": "http://allrecipes.com/recipe/246015/honey-nutty-granola/"
}
| json |
Angelo Mathews criticised his players after the unexpected defeat in the hands of a ranked 11th Zimbabwe.
Mire, known for his quick-fire hitting, was twice dropped as Sri Lanka virtually gave the game away. Sikandar Raza hit an unbeaten 67 and Sean Williams 65 as Zimbabwe stunned the home side in the first one-day international to be held in Galle for 17 years.
The day did not start badly for the home side. Kusal Mendis blasted 86 off 80 balls as Sri Lanka plundered runs off the Zimbabwe attack on a slow pitch.
Upul Tharanga hit 79 and Danushka Gunathilaka 60 after Mathews won the toss and chose to bat. From there, Zimbabwe, one of the minnows of world cricket, went off script.
Mire, who also bowled seven overs before coming out as opening batsman, hit 14 fours and his third-wicket stand of 161 with Williams put the African side well on the way to victory.
Raza claimed the winning runs with a six to compound the humiliation. Raza praised Zimbabwe’s selectors for keeping faith with the squad.
Zimbabwe captain Graeme Cremer said the win was a huge confidence booster.
Zimbabwe still have four one day internationals and a Test to face in Sri Lanka, who have faced increasing jibes over recent performances. | english |
#include "DbMySQLConnection.h"
CMysqlDbConnection::CMysqlDbConnection()
{
}
CMysqlDbConnection::~CMysqlDbConnection()
{
}
bool CMysqlDbConnection::CheckDbConnect()
{
session_backend* pBackEnd = dbsession.get_backend();
if(!pBackEnd)
{
m_bIsConnected = false;
SV_XLOG(XLOG_WARNING,"CMysqlDbConnection::%s,Check connect fail1\n",__FUNCTION__);
return false;
}
mysql_session_backend* pMysql = static_cast<mysql_session_backend*>(pBackEnd);
int nPintResult = 0;
if( (nPintResult=mysql_ping(pMysql->conn_)) != 0)
{
m_bIsConnected = false;
SV_XLOG(XLOG_WARNING,"CMysqlDbConnection::%s,Check connect fail2\n",__FUNCTION__);
return false;
}
m_bIsConnected = true;
SV_XLOG(XLOG_DEBUG,"CMysqlDbConnection::%s,Check Success\n",__FUNCTION__);
return true;
}
int CMysqlDbConnection::ExecuteProcedure()
{
return 0;
}
| cpp |
{"Department":"Прокуратура Сумської області","Region":"Сумська область","Position":"Прокурор відділу організації представництва в суді та при виконанні судових рішень Управління представництва інтересів громадянина або держави в суді та при виконанні судових рішень Прокуратури Сумської області","Name":"<NAME>","Декларації 2013":"","Декларації 2014":"","Декларації 2015":"https://public.nazk.gov.ua/declaration/c01afe67-a9bd-4761-b186-2018c228e45f","Декларації 2016":"https://public.nazk.gov.ua/declaration/76497f4d-844e-47d3-885e-e6405d69d7f4","Фото":"","Я<NAME>":"","Декларації доброчесності":"https://www.gp.gov.ua/integrity_profile/files/cb218141521855e852236ab58d1a3f1b.pdf","type":"prosecutor","key":"koshlyakova_alona_yuriyivna","analytics":[{"y":2015,"i":109754,"k":20.49,"ka":1},{"y":2016,"i":134124,"k":21.11,"ka":1},{"y":2017,"i":266629,"k":21.11,"ka":1}],"declarationsLinks":[{"id":"nacp_c01afe67-a9bd-4761-b186-2018c228e45f","year":2015,"provider":"declarations.com.ua.opendata"},{"id":"nacp_76497f4d-844e-47d3-885e-e6405d69d7f4","year":2016,"provider":"declarations.com.ua.opendata"},{"id":"nacp_2c2262a5-f850-4a5c-9b46-22ef7206b1b0","year":2017,"provider":"declarations.com.ua.opendata"}]} | json |
<filename>package.json
{
"name": "hapi-postcss",
"version": "1.0.0",
"description": "A Hapi Webserver Plugin that allows you to run your css files through PostCSS before sending them to the client. Optionally caches the result in memory or on disk for speed.",
"main": "index.js",
"scripts": {
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/abritinthebay/hapi-postcss.git"
},
"keywords": [
"hapi",
"postcss",
"css",
"plugin"
],
"author": "<NAME>",
"license": "MIT",
"bugs": {
"url": "https://github.com/abritinthebay/hapi-postcss/issues"
},
"homepage": "https://github.com/abritinthebay/hapi-postcss#readme",
"dependencies": {
"@hapi/ammo": "^3.1.0",
"@hapi/boom": "^7.4.2",
"@hapi/bounce": "^1.3.0",
"@hapi/hoek": "^7.1.0",
"@hapi/inert": "^5.2.0",
"@hapi/joi": "^15.0.3",
"postcss": "^7.0.17"
},
"devDependencies": {
"eslint": "^5.16.0"
}
}
| json |
<filename>mdn/web/api/element/clienttop/index.html
---
title: Element.clientTop
slug: Web/API/Element/clientTop
tags:
- API
- CSSOM View
- NeedsAgnostify
- NeedsMarkupWork
- Property
- Reference
browser-compat: api.Element.clientTop
---
<div>{{ APIRef("DOM") }}</div>
<p>
The width of the top border of an element in pixels. It is a read-only,
integer property of element.
</p>
<p>
As it happens, all that lies between the two locations (<code>offsetTop</code>
and client area top) is the element's border. This is because the
<code>offsetTop</code>
indicates the location of the top of the border (not the margin) while the
client area starts immediately below the border, (client area includes
padding.) Therefore, the
<strong>clientTop</strong> value will always equal the integer portion of the
<code>.getComputedStyle()</code> value for "border-top-width". (Actually might
be Math.round(parseFloat()).) For example, if the computed "border-top-width"
is zero, then <strong><code>clientTop</code></strong> is also zero.
</p>
<div class="note">
<p>
<strong>Note:</strong> This property will round the value to an integer. If
you need a fractional value, use {{
domxref("element.getBoundingClientRect()") }}.
</p>
</div>
<p>
<a href="/en-US/Gecko">Gecko</a>-based applications support
<code>clientTop</code> starting with Gecko 1.9 (<a href="/en-US/Firefox_3"
>Firefox 3</a
>, implemented in {{ Bug(111207) }}). This property is not supported in
Firefox 2 and earlier.
</p>
<h2 id="Syntax">Syntax</h2>
<pre class="brush: js">
var <em>top</em> = <var>element</var>.clientTop;
</pre>
<h2 id="Example">Example</h2>
<p>
In the following illustration, the client area is show in white. (The segments
labeled "Top", "Right", etc. have no significance regarding the client area.)
The clientTop value is the distance from where the margin (yellow) area ends
and the padding and content areas (white) begin.
</p>
<div
id="offsetContainer"
style="
margin: 40px 50px 50px;
background-color: rgb(255, 255, 204);
border: 4px dashed black;
color: black;
position: relative;
display: inline-block;
"
>
<div
id="idDiv"
style="
margin: 24px 29px;
border: 24px black solid;
padding: 0px 28px;
width: 199px;
height: 102px;
overflow: auto;
background-color: white;
font-size: 13px !important;
font-family: Arial, sans-serif;
"
>
<p
id="PaddingTopLabel"
style="
text-align: center;
font-style: italic;
font-weight: bold;
font-size: 13px !important;
font-family: Arial, sans-serif;
margin: 0px;
"
>
padding-top
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat.
</p>
<p>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p
id="PaddingBottomLabel"
style="
text-align: center;
font-style: italic;
font-weight: bold;
font-size: 13px !important;
font-family: Arial, sans-serif;
margin: 0px;
"
>
padding-bottom
</p>
</div>
<strong
style="
color: blue;
font-family: arial, sans-serif;
font-size: 13px !important;
font-weight: bold;
left: -32px;
position: absolute;
top: 85px;
"
>Left</strong
>
<strong
style="
color: blue;
font-family: arial, sans-serif;
font-size: 13px !important;
font-weight: bold;
left: 170px;
position: absolute;
top: -24px;
"
>Top</strong
>
<strong
style="
color: blue;
font-family: arial, sans-serif;
font-size: 13px !important;
font-weight: bold;
left: 370px;
position: absolute;
top: 85px;
"
>Right</strong
>
<strong
style="
color: blue;
font-family: arial, sans-serif;
font-size: 13px !important;
font-weight: bold;
left: 164px;
position: absolute;
top: 203px;
"
>Bottom</strong
>
<em>margin-top</em> <em>margin-bottom</em> <em>border-top</em>
<em>border-bottom</em>
</div>
<h2 id="Notes">Notes</h2>
<p>
<code>clientTop</code> was first introduced in the MS IE DHTML object model.
</p>
<h2 id="Specifications">Specifications</h2>
{{Specifications}}
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat}}</p>
| html |
our hands on some of the inside pictures of the baby shower and we must say,
the mommy-to-be looks ravishing and look at the pregnancy glow!
to Anupam Mittal in 2013.
white and the decor looked extremely pretty.
Bilimoria were spotted enjoying at the party.
| english |
Pokemon GO Halloween 2022: Niantic brings Halloween 2022 Part I brings Mega Banette and bucketfuls of Candy bonuses! Get ready for a massive Halloween celebration this year—with none other than Mega Banette making its Pokémon GO debut in Mega Raids! Just like last year, Pokémon GO’s Halloween event will have two parts. Plenty of tricks and treats are in store, including a remix of the Lavender Town music and Halloween-themed Special Research. Of course, plenty of Ghost-type Pokémon will also be out in the wild! Check out the detailed information about upcoming content. For future updates on Pokemon Go, follow InsideSport.IN.
Mega Banette zips over!
Mega Banette will make its Pokémon GO debut in Mega Raids! If you’re lucky, you may encounter a Shiny one!
Pokemon GO Halloween 2022: Niantic brings Halloween 2022 Part I brings Mega Banette and bucketfuls of Candy bonuses!
Timed Research – In addition to the Special Research available to all Trainers, paid tickets for Timed Research will also be available during the event.
- Ticket 1: For US$1 (or the equivalent pricing tier in your local currency, plus any applicable taxes and fees), you can purchase a ticket that grants access to Timed Research featuring encounters with Yamask and Galarian Yamask.
- Ticket 2: For US$5 (or the equivalent pricing tier in your local currency, plus any applicable taxes and fees), you can purchase a ticket that grants access to Timed Research featuring increased Candy bonuses, additional Halloween-themed tasks, and an avatar pose.
Trainers can purchase either one of these tickets, or both. Each ticket features unique Timed Research tasks.
IMPORTANT: Please note that Timed Research will expire. The tasks associated with Timed Research must be completed and their rewards must be claimed before Tuesday, November 1, 2022, at 10:00 a.m. local time.
You can assist Professor Willow and Rhi in Halloween-themed Special Research! Along the way, you’ll learn more about Yamask and Galarian Yamask. Also, for the first time in Pokémon GO, you’ll be able to encounter Shiny Galarian Yamask—if you’re lucky!
Special Research will be available to claim from Thursday, October 20, 2022, at 10:00 a.m. to Tuesday, November 1, 2022, at 10:00 a.m. local time.
The following Pokémon will hatch from 7 km Eggs. Also, for the first time in Pokémon GO, you’ll be able to encounter Shiny Noibat—if you’re lucky! Noibat hatched from these Eggs will also have a greater chance of being Shiny than Noibat found in the wild.
If you’re lucky, you may encounter a Shiny one!
The following Pokémon will appear more frequently in the wild.
If you’re lucky, you may encounter a Shiny one!
During the event, the Spooky Pose found in the in-game shop will be updated to include movement–it will shamble forward! This update will apply to all future and past purchases of the Spooky Pose.
New Halloween-themed avatar items will also be available in the in-game shop!
During both parts of the Halloween Event, PokéStops and Gyms will be decorated for the holiday. We hope you enjoy the colorful decor!
year’s Halloween event. Turn up your in-game sound to feel like you’re taking a stroll through Lavender town!
· 2× Candy for catching Pokémon.
· 2× Candy for hatching Pokémon.
· 2× Candy for transferring Pokémon.
· Trainers level 31 and above will receive one guaranteed Candy XL when walking with their buddy.
Please be aware of your surroundings and follow guidelines from local health authorities when playing Pokémon GO.
For all raids and more on the upcoming contest check the official blog post.
| english |
What is a computer?
Who invented the computer?
What can computers do?
Are computers conscious?
What is the impact of computer artificial intelligence (AI) on society?
Who Invented the Internet?
Why Was Frederick Douglass’s Marriage to Helen Pitts Controversial?
Why Do We Drop a Ball on New Year’s Eve?
Why Is Christmas in December?
Why Are There Only 28 Days in February?
Do We Really Swallow Spiders in Our Sleep?
in these related Britannica articles:
| english |
<gh_stars>0
{
"name": "mysql-employee-tracker",
"version": "1.0.0",
"description": "Many business owners want to want to be able to view and manage their departments, roles, and employees in their company in a way that allows them to structure their organization properly. This node-based application allows business owners to do just that. Add, view, and update your departments and employee information with ease using Employee Tracker.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm i && node index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dawisen/MySQL-Employee-Tracker.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/dawisen/MySQL-Employee-Tracker/issues"
},
"homepage": "https://github.com/dawisen/MySQL-Employee-Tracker#readme",
"dependencies": {
"console.table": "^0.10.0",
"inquirer": "^7.3.3",
"mysql": "^2.18.1",
"util": "^0.12.3"
}
}
| json |
<reponame>sozonome/spoker
export const ALLOWED_CHAR_CHECK: RegExp =
/^(?!.*([!@#$%^&*(),.?":{}|<>,.#/])\1)([\w -]+)$/g;
| typescript |
HPCL reported 2QFY22 in‐line with our and street estimates with operating profits at Rs 30. 1bn (‐16% YoY; ‐6% QoQ). During the quarter, HPCL’s operating profits were impacted by reduced refinery utilization and higher operating costs due to ongoing maintenance and expansion. HPCL has added two new units and revamped six units at its Mumbai refinery (MR), which are under stabilization; the throughput at MR is expected to reach full capacity in 4QFY22. Similarly, the expansion of Vizag refinery (VR) to 15mmt (from 8. 3mmt) is expected to complete in FY22, with ramp‐up in FY23. After the proposed expansion HPCL has at present no plans to invest in incremental refining capacity and plans to add renewable capacity in green hydrogen going ahead. In our view, with maintenance/expansion of MR now complete, and that at VR expected to reach conclusion the earnings are going to improve over 2HFY23 and FY23, more so as refinery margin environment remains strong. Maintain BUY with a TP of Rs 410/sh.
* 1QFY22 Profitability: The Ebitda and PAT for the quarter stood at Rs 30. 1bn (‐ 16% YoY; ‐6% QoQ) and Rs 19. 2bn (‐22% YoY; +7% QoQ). Operating profits impacted by comparatively weaker (compared to peers) GRMs and lower refinery utilization.
* Refinery Utilization: The refining throughput stood flat QoQ at 2. 53mmt (1Q: 2. 5mmt), with refinery utilization at 64% (1Q: 63%), as throughput was restricted on account of maintenance in both MR & VR. The throughout at MR (MR) stood at 1. 03mmt (55% utilization) and at VR at 1. 51mmt (73% utilization). Through at MR expected to improve over 2HFY22 as new/revamped units stabilize. VR expansion to complete in FY22 and ramp‐up is expected over FY23.
* Gross Refinery Margin: The GRMs stood QoQ weaker at USD 2. 44/bbl, despite sequential improvement in refinery margin environment, on account of low utilization and higher fuel/operating costs per barrel, offsetting stronger cracks.
* Marketing sales: Total Domestic products sales stood at 9. 1mmt (+8% YoY; +3% QoQ), vs industry growth of 6. 4% YoY during the quarter. MS sales reported a growth of 13% YoY (industry: 11. 7% YoY) and HSD sales growth of 9% YoY (industry: 8. 8% YoY), with market share gains across MS and HSD in the 2Q.
* Marketing margins: As per our assessment, the marketing margin during the quarter stood at Rs 5700/t (1Q: Rs 5065/t), primarily on QoQ improvement in MS and firm HSD margins. HPCL has discontinued disclosure of marketing inventory gains, so accurate assessment of gross margins to that extent is challenging.
AT CMP HPCL is trading at a P/E of 5. 4x FY24e, vs 7. 4x FY24e, implied by our target price. We value HPCL at Rs 410/sh, on SOTP basis, with an equity value of Rs 351/sh for the standalone business, Rs 51/sh for investment in HMEL Refinery and Rs 9/sh for other investment. | english |
// Package main DigitalRebar Provision Server
//
// An RestFUL API-driven Provisioner and DHCP server
//
package main
import (
"os"
"github.com/digitalrebar/provision/embedded"
"github.com/digitalrebar/provision/server"
"github.com/jessevdk/go-flags"
)
var c_opts server.ProgOpts
func main() {
parser := flags.NewParser(&c_opts, flags.Default)
if _, err := parser.Parse(); err != nil {
if flagsErr, ok := err.(*flags.Error); ok && flagsErr.Type == flags.ErrHelp {
os.Exit(0)
} else {
os.Exit(1)
}
}
embedded.IncludeMeFunction()
server.Server(&c_opts)
}
| go |
{
"$id" : "https://progenetix.org/services/schemas/Collation/v2020-12-08",
"$schema" : "https://json-schema.org/draft/2020-12/schema",
"description" : "A Collation summarizes information of all biosamples matching a given term (e.g. PMID or NCIT code), as well as the connected items if the code is part of a hierarchy (paths leading to the code, child terms).\n",
"examples" : [],
"meta" : {
"contributors" : [
{
"description" : "<NAME>",
"id" : "orcid:0000-0002-9903-4248"
}
],
"provenance" : [
{
"description" : "Progenetix `bycon` project",
"id" : "https://github.com/progenetix/bycon/"
}
],
"sb_status" : "community",
"used_by" : [
{
"description" : "Progenetix database schema (Beacon+ backend)",
"id" : "https://github.com/progenetix/schemas/"
}
]
},
"properties" : {
"childTerms" : {
"description" : "All downstream terms of this term in a hierarchical system.\n",
"type" : "array"
},
"codeMatches" : {
"description" : "The number of biosamples in the collection with this code. This can be 0 if the entity is only represented through its child terms.\n",
"type" : "integer"
},
"count" : {
"description" : "The number of biosamples in the collection with this code or one of its child terms.\n",
"type" : "integer"
},
"hierarchyPaths" : {
"description" : "All term paths leading to any instance of this code from the hierarchy root term.\n",
"items" : {
"$ref" : "HierarchyPath.yaml#/properties"
},
"type" : "array"
},
"id" : {
"examples" : [
"NCIT:C9272"
],
"type" : "string"
},
"label" : {
"examples" : [
"Salivary Gland Carcinoma"
],
"type" : "string"
}
},
"title" : "Collation"
}
| json |
<gh_stars>0
@import url('https://fonts.googleapis.com/css2? family = Atma: wght @ 300; 500; 600 & display = swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
header{
height: 90px;
background-color: rgba(0,0,0, 0.3);
padding:23px;
}
#logo img {
height: 50px;
margin-left: 15px;
}
.cabecalho{
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
color: white;
margin: 0px 30px;
font-family:'Caveat', cursive;
}
#menus ul{
display: flex;
list-style: none;
}
#menus a{
font-size: 14px;
margin-left: 15px;
text-decoration: none;
color: white;
letter-spacing: 2px;
}
#menus img{
height: 22px;
}
#text-news a{
color: #e1def1;
}
main{
height: 78vh;
padding: 35px 30px 0px 30px;
}
#banner{
background-image: url('img/Novidades.PNG');
background-repeat: no-repeat;
background-size: 100%;
background-position: center;
margin: 0 auto;
height: 420px;
width: 87%;
}
/* --- rodapé --- */
.footer-primary{
width: 100%;
height: 80px;
background-color:rgba(0,0,0, 0.85);
color: white;
font-size: 12px;
display: flex;
justify-content: center;
align-items: center;
font-family:'Caveat', cursive;
} | css |
<reponame>redwrasse/wavenetlike
from wavenetlike.analyzers import DatasetAnalyzer
from wavenetlike.datasetid import TorchAudioDataSetId
def analyzer_example():
dataset = TorchAudioDataSetId("SPEECHCOMMANDS")
data_analyzer = DatasetAnalyzer(dataset)
data_analyzer.analyze_dataset()
analysis_res = data_analyzer.get_analysis_result()
print(analysis_res)
if __name__ == "__main__":
analyzer_example()
| python |
import FWCore.ParameterSet.Config as cms
#Tracks without extra and hits
#AOD content
RecoTrackerAOD = cms.PSet(
outputCommands = cms.untracked.vstring(
'keep recoTracks_ctfWithMaterialTracksP5_*_*',
'keep recoTracks_ctfWithMaterialTracksP5LHCNavigation_*_*',
'keep recoTracks_rsWithMaterialTracksP5_*_*',
'keep recoTracks_cosmictrackfinderP5_*_*',
'keep recoTracks_beamhaloTracks_*_*',
'keep recoTracks_splittedTracksP5_*_*',
'keep recoTracks_ctfWithMaterialTracksP5Top_*_*',
'keep recoTracks_rsWithMaterialTracksP5Top_*_*',
'keep recoTracks_cosmictrackfinderP5Top_*_*',
'keep recoTracks_ctfWithMaterialTracksP5Bottom_*_*',
'keep recoTracks_rsWithMaterialTracksP5Bottom_*_*',
'keep recoTracks_cosmictrackfinderP5Bottom_*_*',
'keep recoTracks_regionalCosmicTracks_*_*',
'keep *_dedxHitInfo_*_*',
'keep *_dedxHarmonic2_*_*',
'keep *_dedxHitInfoCTF_*_*',
'keep *_dedxHarmonic2CTF_*_*',
'keep *_dedxHitInfoCosmicTF_*_*',
'keep *_dedxHarmonic2CosmicTF_*_*')
)
#RECO content
RecoTrackerRECO = cms.PSet(
outputCommands = cms.untracked.vstring(
'keep recoTrackExtras_ctfWithMaterialTracksP5_*_*',
'keep TrackingRecHitsOwned_ctfWithMaterialTracksP5_*_*',
'keep recoTrackExtras_ctfWithMaterialTracksP5LHCNavigation_*_*',
'keep TrackingRecHitsOwned_ctfWithMaterialTracksP5LHCNavigation_*_*',
'keep recoTrackExtras_rsWithMaterialTracksP5_*_*',
'keep TrackingRecHitsOwned_rsWithMaterialTracksP5_*_*',
'keep recoTrackExtras_cosmictrackfinderP5_*_*',
'keep TrackingRecHitsOwned_cosmictrackfinderP5_*_*',
'keep recoTrackExtras_beamhaloTracks_*_*',
'keep TrackingRecHitsOwned_beamhaloTracks_*_*',
'keep recoTrackExtras_splittedTracksP5_*_*',
'keep TrackingRecHitsOwned_splittedTracksP5_*_*',
'keep recoTrackExtras_ctfWithMaterialTracksP5Top_*_*',
'keep TrackingRecHitsOwned_ctfWithMaterialTracksP5Top_*_*',
'keep recoTrackExtras_rsWithMaterialTracksP5Top_*_*',
'keep TrackingRecHitsOwned_rsWithMaterialTracksP5Top_*_*',
'keep recoTrackExtras_cosmictrackfinderP5Top_*_*',
'keep TrackingRecHitsOwned_cosmictrackfinderP5Top_*_*',
'keep recoTrackExtras_ctfWithMaterialTracksP5Bottom_*_*',
'keep TrackingRecHitsOwned_ctfWithMaterialTracksP5Bottom_*_*',
'keep recoTrackExtras_rsWithMaterialTracksP5Bottom_*_*',
'keep TrackingRecHitsOwned_rsWithMaterialTracksP5Bottom_*_*',
'keep recoTrackExtras_cosmictrackfinderP5Bottom_*_*',
'keep TrackingRecHitsOwned_cosmictrackfinderP5Bottom_*_*',
'keep recoTrackExtras_regionalCosmicTracks_*_*',
'keep TrackingRecHitsOwned_regionalCosmicTracks_*_*',
'keep *_dedxTruncated40_*_*',
'keep *_dedxTruncated40CTF_*_*',
'keep *_dedxTruncated40CosmicTF_*_*',
'keep recoTracks_cosmicDCTracks_*_*',
'keep recoTrackExtras_cosmicDCTracks_*_*',
'keep TrackingRecHitsOwned_cosmicDCTracks_*_*')
)
RecoTrackerRECO.outputCommands.extend(RecoTrackerAOD.outputCommands)
#Full Event content
RecoTrackerFEVT = cms.PSet(
outputCommands = cms.untracked.vstring()
)
RecoTrackerFEVT.outputCommands.extend(RecoTrackerRECO.outputCommands)
| python |
<reponame>OmnesRes/ATGC2<gh_stars>1-10
import pylab as plt
import numpy as np
import pickle
import pathlib
path = pathlib.Path.cwd()
from matplotlib import cm
if path.stem == 'ATGC2':
cwd = path
else:
cwd = list(path.parents)[::-1][path.parts.index('ATGC2')]
import sys
sys.path.append(str(cwd))
D, samples = pickle.load(open(cwd / 'figures' / 'controls' / 'samples' / 'sim_data' / 'sample_info' / 'experiment_1' / 'sim_data.pkl', 'rb'))
##get x_true and y_true
x_true = []
indexes = []
for i in range(1, 4):
x_temp = []
temp_indexes = []
for sample_idx in range(len(samples['type'])):
if sample_idx in np.where(np.array(samples['type']) == i)[0]:
variants = D['class'][np.where(D['sample_idx'] == sample_idx)]
x_temp.append(len(np.where(variants != 0)[0]))
temp_indexes.append(sample_idx)
x_true.append(x_temp)
indexes.append(temp_indexes)
predictions = [np.array(samples['values'])[type_indexes] for type_indexes in indexes]
paired = [cm.get_cmap('Paired')(i) for i in range(12) if i not in [4, 5]]
fig = plt.figure()
ax = fig.add_subplot(111)
fig.subplots_adjust(
top=1.0,
bottom=0.05,
left=0.035,
right=1.0,
hspace=0.2,
wspace=0.2)
for index in range(3):
ax.scatter(x_true[index], predictions[index], color=paired[index * 2 + 1], edgecolor='k', linewidth=.5, label='Sample Type ' + str(index + 1))
ax.set_yticks([])
ax.set_xticks([])
ax.set_xlim(-6, sorted(np.concatenate(x_true))[-2] - 5)
ax.set_ylim(-60, sorted(np.concatenate(predictions))[-2] + 150)
ax.set_ylabel('Bag Value', fontsize=16, labelpad=0)
ax.set_xlabel('Key Instance Count', fontsize=16, labelpad=0)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_visible(False)
ax.spines['bottom'].set_visible(False)
ax.legend(loc=(.01, .8), fontsize=12, frameon=False)
plt.savefig(cwd / 'figures' / 'controls' / 'samples' / 'sim_data' / 'sample_info' / 'experiment_1' / 'figure_predictions.png', dpi=300)
| python |
// +build integration
package function_test
import (
"context"
"os"
"reflect"
"testing"
"time"
boson "github.com/boson-project/func"
"github.com/boson-project/func/buildpacks"
"github.com/boson-project/func/docker"
"github.com/boson-project/func/knative"
)
/*
NOTE: Running integration tests locally requires a configured test cluster.
Test failures may require manual removal of dangling resources.
## Integration Cluster
These integration tests require a properly configured cluster,
such as that which is setup and configured in CI (see .github/workflows).
A local KinD cluster can be started via:
./hack/allocate.sh && ./hack/configure.sh
## Integration Testing
These tests can be run via the make target:
make test-integration
or manually by specifying the tag
go test -v -tags integration ./...
## Teardown and Cleanup
Tests should clean up after themselves. In the event of failures, one may
need to manually remove files:
rm -rf ./testdata/example.com
The test cluster is not automatically removed, as it can be reused. To remove:
./hack/delete.sh
*/
const (
// DefaultRegistry must contain both the registry host and
// registry namespace at this time. This will likely be
// split and defaulted to the forthcoming in-cluster registry.
DefaultRegistry = "localhost:5000/func"
// DefaultNamespace for the underlying deployments. Must be the same
// as is set up and configured (see hack/configure.sh)
DefaultNamespace = "func"
)
func TestList(t *testing.T) {
verbose := true
// Assemble
lister, err := knative.NewLister(DefaultNamespace)
if err != nil {
t.Fatal(err)
}
client := boson.New(
boson.WithLister(lister),
boson.WithVerbose(verbose))
// Act
names, err := client.List(context.Background())
if err != nil {
t.Fatal(err)
}
// Assert
if len(names) != 0 {
t.Fatalf("Expected no Functions, got %v", names)
}
}
// TestNew creates
func TestNew(t *testing.T) {
defer within(t, "testdata/example.com/testnew")()
verbose := true
client := newClient(verbose)
// Act
if err := client.New(context.Background(), boson.Function{Name: "testnew", Root: ".", Runtime: "go"}); err != nil {
t.Fatal(err)
}
defer del(t, client, "testnew")
// Assert
items, err := client.List(context.Background())
names := []string{}
for _, item := range items {
names = append(names, item.Name)
}
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(names, []string{"testnew"}) {
t.Fatalf("Expected function list ['testnew'], got %v", names)
}
}
// TestDeploy updates
func TestDeploy(t *testing.T) {
defer within(t, "testdata/example.com/deploy")()
verbose := true
client := newClient(verbose)
if err := client.New(context.Background(), boson.Function{Name: "deploy", Root: ".", Runtime: "go"}); err != nil {
t.Fatal(err)
}
defer del(t, client, "deploy")
if err := client.Deploy(context.Background(), "."); err != nil {
t.Fatal(err)
}
}
// TestRemove deletes
func TestRemove(t *testing.T) {
defer within(t, "testdata/example.com/remove")()
verbose := true
client := newClient(verbose)
if err := client.New(context.Background(), boson.Function{Name: "remove", Root: ".", Runtime: "go"}); err != nil {
t.Fatal(err)
}
waitFor(t, client, "remove")
if err := client.Remove(context.Background(), boson.Function{Name: "remove"}); err != nil {
t.Fatal(err)
}
names, err := client.List(context.Background())
if err != nil {
t.Fatal(err)
}
if len(names) != 0 {
t.Fatalf("Expected empty Functions list, got %v", names)
}
}
// ***********
// Helpers
// ***********
// newClient creates an instance of the func client whose concrete impls
// match those created by the kn func plugin CLI.
func newClient(verbose bool) *boson.Client {
builder := buildpacks.NewBuilder()
builder.Verbose = verbose
pusher, err := docker.NewPusher()
if err != nil {
panic(err)
}
pusher.Verbose = verbose
deployer, err := knative.NewDeployer(DefaultNamespace)
if err != nil {
panic(err) // TODO: remove error from deployer constructor
}
deployer.Verbose = verbose
remover, err := knative.NewRemover(DefaultNamespace)
if err != nil {
panic(err) // TODO: remove error from remover constructor
}
remover.Verbose = verbose
lister, err := knative.NewLister(DefaultNamespace)
if err != nil {
panic(err) // TODO: remove error from lister constructor
}
lister.Verbose = verbose
return boson.New(
boson.WithRegistry(DefaultRegistry),
boson.WithVerbose(verbose),
boson.WithBuilder(builder),
boson.WithPusher(pusher),
boson.WithDeployer(deployer),
boson.WithRemover(remover),
boson.WithLister(lister),
)
}
// Del cleans up after a test by removing a function by name.
// (test fails if the named function does not exist)
//
// Intended to be run in a defer statement immediately after creation, del
// works around the asynchronicity of the underlying platform's creation
// step by polling the provider until the names function becomes available
// (or the test times out), before firing off a deletion request.
// Of course, ideally this would be replaced by the use of a synchronous
// method, or at a minimum a way to register a callback/listener for the
// creation event. This is what we have for now, and the show must go on.
func del(t *testing.T, c *boson.Client, name string) {
t.Helper()
waitFor(t, c, name)
if err := c.Remove(context.Background(), boson.Function{Name: name}); err != nil {
t.Fatal(err)
}
}
// waitFor the named Function to become available in List output.
// TODO: the API should be synchronous, but that depends first on
// Create returning the derived name such that we can bake polling in.
// Ideally the Boson provider's Creaet would be made syncrhonous.
func waitFor(t *testing.T, c *boson.Client, name string) {
t.Helper()
var pollInterval = 2 * time.Second
for { // ever (i.e. defer to global test timeout)
nn, err := c.List(context.Background())
if err != nil {
t.Fatal(err)
}
for _, n := range nn {
if n.Name == name {
return
}
}
time.Sleep(pollInterval)
}
}
// Create the given directory, CD to it, and return a function which can be
// run in a defer statement to return to the original directory and cleanup.
// Note must be executed, not deferred itself
// NO: defer within(t, "somedir")
// YES: defer within(t, "somedir")()
func within(t *testing.T, root string) func() {
t.Helper()
cwd := pwd(t)
mkdir(t, root)
cd(t, root)
return func() {
cd(t, cwd)
rm(t, root)
}
}
func pwd(t *testing.T) string {
t.Helper()
dir, err := os.Getwd()
if err != nil {
t.Fatal(err)
}
return dir
}
func mkdir(t *testing.T, dir string) {
t.Helper()
if err := os.MkdirAll(dir, 0700); err != nil {
t.Fatal(err)
}
}
func cd(t *testing.T, dir string) {
t.Helper()
if err := os.Chdir(dir); err != nil {
t.Fatal(err)
}
}
func rm(t *testing.T, dir string) {
t.Helper()
if err := os.RemoveAll(dir); err != nil {
t.Fatal(err)
}
}
func touch(file string) {
_, err := os.Stat(file)
if os.IsNotExist(err) {
f, err := os.Create(file)
if err != nil {
panic(err)
}
defer f.Close()
}
t := time.Now().Local()
if err := os.Chtimes(file, t, t); err != nil {
panic(err)
}
}
| go |
{"html_attributions": [], "result": {"rating": 3.9, "reviews": [{"author_name": "<NAME>25", "author_url": "https://www.google.com/maps/contrib/101573562620072850471/reviews", "language": "en", "profile_photo_url": "https://lh3.ggpht.com/-DOZYrUN51AY/AAAAAAAAAAI/AAAAAAAAAAA/uLRKFCKYk0g/s128-c0x00000000-cc-rp-mo/photo.jpg", "rating": 5, "relative_time_description": "8 months ago", "text": "This is a small station with relatively frequent trains. It is a station on a single line so there is only one one platform with trains going in both directions.", "time": 1550797321}, {"author_name": "<NAME>", "author_url": "https://www.google.com/maps/contrib/116464893640682801214/reviews", "language": "en", "profile_photo_url": "https://lh4.ggpht.com/-audte5OsLzY/AAAAAAAAAAI/AAAAAAAAAAA/5AYcGyE9N9Y/s128-c0x00000000-cc-rp-mo-ba5/photo.jpg", "rating": 5, "relative_time_description": "10 months ago", "text": "Information board, one platform - so check direction before getting on board, as trains are within a few minutes of each other - cheap train travel into Bristol Temple Meads - number 9 & 72 run into BTM if the trains are out of use and you need to guarantee to get there, only 100 yards away", "time": 1543515049}, {"author_name": "<NAME>", "author_url": "https://www.google.com/maps/contrib/100314070243628443551/reviews", "language": "en", "profile_photo_url": "https://lh4.ggpht.com/-ZiT8kpYMOoI/AAAAAAAAAAI/AAAAAAAAAAA/JHu1fWkkjyE/s128-c0x00000000-cc-rp-mo-ba4/photo.jpg", "rating": 4, "relative_time_description": "2 years ago", "text": "Very useful, low cost trains into central Bristol. Could be more frequent but usually reasonably on-time. Season ticket is excellent value.", "time": 1499325880}, {"author_name": "<NAME>", "author_url": "https://www.google.com/maps/contrib/105421555956186226779/reviews", "language": "en", "profile_photo_url": "https://lh3.ggpht.com/-nuDnnb83I_c/AAAAAAAAAAI/AAAAAAAAAAA/aO14bU_Zu7w/s128-c0x00000000-cc-rp-mo/photo.jpg", "rating": 4, "relative_time_description": "a year ago", "text": "Where i lost my sweet sweet virginity #blessed", "time": 1524856144}, {"author_name": "Annie", "author_url": "https://www.google.com/maps/contrib/104264672651910269387/reviews", "language": "en", "profile_photo_url": "https://lh3.ggpht.com/-rK--8PzGkFk/AAAAAAAAAAI/AAAAAAAAAAA/okzSJLsswl8/s128-c0x00000000-cc-rp-mo-ba6/photo.jpg", "rating": 4, "relative_time_description": "a year ago", "text": "Handy little train station for traveling to inner city area's, also trains go to Brean down and Weston Super Mare, so saves a lot of time for locals instead of going to Temple Meads.", "time": 1515251049}]}, "status": "OK"} | json |
Union Territory of Puducherry is gearing up to introduce the Hop on Brewery Tour Bus, a one-day round trip from Chennai to Puducherry on weekends, to attract more visitors, particularly those interested in exploring local alcoholic beverages.
The inaugural journey, organized by Catamaran Brewing Company, is scheduled for April 22.
Puducherry, a popular tourist destination in South India, boasts a distinctive urban architectural style. The former French colony is well-known for its affordable alcohol compared to other states.
Visitors to Puducherry can find alcoholic beverages from various Indian states like Tamil Nadu, Kerala, Karnataka, Goa, and Maharashtra, and countries like France, Italy, Germany, and Japan.
Catamaran Brewing Company, established in 2021, operates a small-scale brewery in the city center. Customers can choose from over eight different types of beer, all reportedly made without chemicals, using ingredients such as wheat, barley, guava, cashew, mango, jackfruit, Seeraga Samba rice, conch flower, hibiscus flower, coriander leaves, and Nannari juice.
The complete package, including beer and food, is priced at Rs 3,000, according to Catamaran.
Rangaraj Narayanasamy, a business partner, stated that the company will offer a guided tour of their microbrewery, followed by two hours of unlimited beer service and a sumptuous three-course meal.
Depending on their interests, tourists will also visit one or more renowned Puducherry Union Territory attractions before arriving at Catamaran, where they can see “live beer production" and sample it alongside traditional cuisine.
The bus will operate on Saturdays and Sundays, departing from a location in Chennai around 10:30 am and returning no later than 9:00 pm.
Sources clarified that beer will not be served on the bus, as doing so would violate the law, addressing a misconception that arose after the company promoted the “Beer Bus" initiative on social media. The beverage will be available at the Puducherry brewery. The company has partnered with a luxury bus provider to charter an air-conditioned Volvo bus, accommodating over 35 tourists per group.
The primary target audience for the initiative reportedly includes IT professionals and MNC employees. Catamaran has established different pricing tiers for beer drinkers, abstainers, and children accompanying an adult.
“Catamaran also offers speciality mocktails, food, and non-alcoholic beverages," Rangaraj noted. He added that Catamaran plans to expand the tour to cover more major cities and might extend operations to include holidays and midweek dates, depending on demand. | english |
Dis book na about Job and na to help us Ansa di kweshon about how human being dey sofa: Weda na bikos of sin pesin dey sofa or na God make pipol dey sofa? Just like di bad-bad tins wey happen before wey use some pesin take show di ansa to some kweshons about wetin life mean, na so too Job tok about dis tin wey sey God go bless good pipol kon ponish doz wey dey do bad, den doz wey dey live betta life go prosper and doz wey dey do wiked tins, go sofa di ponishment.
Di book show sey Job na betta pesin wey dey do wetin dey rite for God eye and wey dey prosper, but e kon bigin sofa at wons as e get diziz full body and all en shidren kon die finish. But e nor ever curse God and e bilive sey e nor do any bad tin even wen en friends dey sey make e tok wetin e do make God for forgi-am, bikos na sin dey kause dis kind sofa. Di main part for di book na di Hibru songs wey show how Job and en friends tok to one anoda. Di three friends like Job mate and one small boy wey bilive sey Job do wiked tins and na dis make am dey sofa. But Job still sey e nor do any bad tin and e kon beg God make E tink am as e ensef dey tink am (10:3-7). Bikos Job know sey e nor do any bad tin, e kon ask God sey make E judge am or end all di wahala wey dey happen to am. For di last chapters, God kon finally send one strong breeze wey ansa Job many kweshon. God diskribe en divine wisdom and how E take kreate di world. God tell Job sey ordinary human being nor go fit do or tink as God dey tink. God kon safe Job from all wetin en friends dey tok and dis one kon show sey nor bi pesin sin really make am dey sofa all wetin e dey sofa. At di end, Job kon prosper again and en life kon betta pass as e bi before.
1 E get one man wey dem dey koll Job, e dey stay for Uz land and e dey do wetin God wont. E dey serve God with klean belle and e nor dey do bad tins. 2 E born seven sons and three dotas. 3 E till get 7,000 sheep, 3,000 kamel, 500 oxen, 500 donkey wey bi woman, plenty savant and na-im get money pass for di east side for di kountry.
4 Job sons dey always do party one-by-one for dia house, wey evribody dey kom chop and drink and dia three sistas dey kom too. 5 One dia party finish, Job go koll and santify dem. For early morning, Job go offa sakrifice for all of dem. “Bikos e bilive sey dem fit nor know sey dem don sin and curse God.” Job dey do dis tin evritime.
So Satan komot from God present.
20 Den Job stand up, tear en klot; barb en hair kon fall face groun. 21 Den e sey,
and wen I die, I nor go karry anytin follow body.
Na God dey give and E don take.
22 With all dis tins wey dey happen so, Job nor ever blame, sin or curse God.
| english |
<reponame>dmitry-zhemchugov/ngx-bootstrap
import { Component } from '@angular/core';
@Component({
selector: 'demo-pagination-page-changed-event',
templateUrl: './page-changed-event.html'
})
export class DemoPaginationPageChangedComponent {
currentPage = 4;
page: number;
pageChanged(event: any): void {
this.page = event.page;
}
}
| typescript |
Telangana Rashtra Samithi is all set to record yet another historical win in the elections to 120 municipalities and 10 municipal corporations in the state conducted on January 22. The results are going to be declared on Saturday, when the counting takes place.
Going by the polling trends and an exit polls conducted by the Centre for Psephology Studies (CPS), the TRS is going to register a landslide victory, capturing 104 to 109 municipalities and almost all the 10 municipal corporations in the state.
The Congress might win 0-4 municipalities and 0-1 corporation, the BJP might win at the most two municipalities, if it can and the MIM may win two.
It will be a one-sided affair in the elections and according to estimates, there will be tough contest only in seven to nine municipalities and none in corporations.
“So, it will be more or less a clean sweep for the TRS. It is going to be an unprecedented record for the TRS, as no other party in the country has won more than 90 per cent of the civic bodies,” an analyst said.
The TRS has recorded victories in every election it took part since the formation of the Telangana State.
In the assembly elections held in December last, it won three-fourths assembly seats, more than 50 per cent seats in Lok Sabha elections and captured all the Zilla Parishads and 90 per cent of the mandal parishad elections in the state.
Even in the present municipal elections it will get an impressive and decisive victory, exit polls predicted. | english |
<reponame>kalufya/snow-owl
/*
* Copyright 2011-2021 B2i Healthcare Pte Ltd, http://b2i.sg
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.b2international.snowowl.snomed.datastore.request;
import java.util.Set;
import javax.validation.constraints.Min;
import com.b2international.commons.exceptions.BadRequestException;
import com.b2international.snowowl.core.date.EffectiveTimes;
import com.b2international.snowowl.core.domain.TransactionContext;
import com.b2international.snowowl.snomed.common.SnomedRf2Headers;
import com.b2international.snowowl.snomed.core.domain.RelationshipValue;
import com.b2international.snowowl.snomed.datastore.index.entry.SnomedConceptDocument;
import com.b2international.snowowl.snomed.datastore.index.entry.SnomedRelationshipIndexEntry;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
/**
* @since 4.5
*/
public final class SnomedRelationshipUpdateRequest extends SnomedComponentUpdateRequest {
// Not @NotEmpty, update of type ID is optional
private String typeId;
// Not @NotEmpty, update of destination ID is optional
private String destinationId;
// Not @NotNull, update of relationship value is optional
private RelationshipValue value;
@Min(0)
private Integer relationshipGroup;
@Min(0)
private Integer unionGroup;
// Not @NotEmpty, update of characteristic type ID is optional
private String characteristicTypeId;
// Not @NotEmpty, update of modifier ID is optional
private String modifierId;
SnomedRelationshipUpdateRequest(final String componentId) {
super(componentId);
}
void setTypeId(final String typeId) {
this.typeId = typeId;
}
void setDestinationId(final String destinationId) {
this.destinationId = destinationId;
}
void setValue(final RelationshipValue value) {
this.value = value;
}
void setRelationshipGroup(final Integer relationshipGroup) {
this.relationshipGroup = relationshipGroup;
}
void setUnionGroup(final Integer unionGroup) {
this.unionGroup = unionGroup;
}
void setCharacteristicTypeId(final String characteristicTypeId) {
this.characteristicTypeId = characteristicTypeId;
}
void setModifierId(final String modifierId) {
this.modifierId = modifierId;
}
@Override
public Boolean execute(final TransactionContext context) {
if (!Strings.isNullOrEmpty(destinationId) && value != null) {
throw new BadRequestException("'destinationId' and 'value' can not be updated at same time");
}
final SnomedRelationshipIndexEntry relationship = context.lookup(componentId(), SnomedRelationshipIndexEntry.class);
final SnomedRelationshipIndexEntry.Builder updatedRelationship = SnomedRelationshipIndexEntry.builder(relationship);
boolean changed = false;
changed |= updateStatus(context, relationship, updatedRelationship);
changed |= updateModuleId(context, relationship, updatedRelationship);
changed |= updateTypeId(context, relationship, updatedRelationship);
changed |= updateDestinationId(context, relationship, updatedRelationship);
changed |= updateValue(context, relationship, updatedRelationship);
changed |= updateGroup(context, relationship, updatedRelationship);
changed |= updateUnionGroup(context, relationship, updatedRelationship);
changed |= updateCharacteristicTypeId(context, relationship, updatedRelationship);
changed |= updateModifierId(context, relationship, updatedRelationship);
changed |= updateEffectiveTime(relationship, updatedRelationship);
if (changed) {
if (!isEffectiveTimeUpdate() && relationship.getEffectiveTime() != EffectiveTimes.UNSET_EFFECTIVE_TIME) {
updatedRelationship.effectiveTime(EffectiveTimes.UNSET_EFFECTIVE_TIME);
}
context.update(relationship, updatedRelationship.build());
}
return changed;
}
@Override
protected String getInactivationIndicatorRefSetId() {
throw new UnsupportedOperationException("Relationship inactivation does not support inactivationProperties yet");
}
private String ensureConceptExists(final String conceptId, final TransactionContext context) {
return context.lookup(conceptId, SnomedConceptDocument.class).getId();
}
private boolean updateTypeId(final TransactionContext context, final SnomedRelationshipIndexEntry relationship, final SnomedRelationshipIndexEntry.Builder updatedRelationship) {
return updateProperty(typeId, () -> relationship.getTypeId(), newTypeId -> {
checkUpdateOnReleased(relationship, SnomedRf2Headers.FIELD_TYPE_ID, newTypeId);
updatedRelationship.typeId(ensureConceptExists(newTypeId, context));
});
}
private boolean updateDestinationId(final TransactionContext context, final SnomedRelationshipIndexEntry relationship, final SnomedRelationshipIndexEntry.Builder updatedRelationship) {
return updateProperty(destinationId, () -> relationship.getDestinationId(), newDestinationId -> {
checkUpdateOnReleased(relationship, SnomedRf2Headers.FIELD_DESTINATION_ID, newDestinationId);
updatedRelationship.destinationId(ensureConceptExists(newDestinationId, context));
});
}
private boolean updateValue(final TransactionContext context, final SnomedRelationshipIndexEntry relationship, final SnomedRelationshipIndexEntry.Builder updatedRelationship) {
return updateProperty(value, () -> relationship.getValueAsObject(), newValue -> {
checkUpdateOnReleased(relationship, SnomedRf2Headers.FIELD_VALUE, newValue);
updatedRelationship.value(newValue);
});
}
private boolean updateGroup(final TransactionContext context, final SnomedRelationshipIndexEntry relationship, final SnomedRelationshipIndexEntry.Builder updatedRelationship) {
return updateProperty(relationshipGroup, () -> relationship.getRelationshipGroup(), updatedRelationship::relationshipGroup);
}
private boolean updateUnionGroup(final TransactionContext context, final SnomedRelationshipIndexEntry relationship, final SnomedRelationshipIndexEntry.Builder updatedRelationship) {
return updateProperty(unionGroup, () -> relationship.getUnionGroup(), updatedRelationship::unionGroup);
}
private boolean updateCharacteristicTypeId(final TransactionContext context, final SnomedRelationshipIndexEntry relationship, final SnomedRelationshipIndexEntry.Builder updatedRelationship) {
return updateProperty(characteristicTypeId, () -> relationship.getCharacteristicTypeId(), newCharacteristicTypeId -> updatedRelationship.characteristicTypeId(ensureConceptExists(newCharacteristicTypeId, context)));
}
private boolean updateModifierId(final TransactionContext context, final SnomedRelationshipIndexEntry relationship, final SnomedRelationshipIndexEntry.Builder updatedRelationship) {
return updateProperty(modifierId, () -> relationship.getModifierId(), newModifierId -> {
updatedRelationship.modifierId(ensureConceptExists(newModifierId, context));
});
}
@Override
public Set<String> getRequiredComponentIds(final TransactionContext context) {
final ImmutableSet.Builder<String> ids = ImmutableSet.builder();
ids.add(componentId());
if (typeId != null) { ids.add(typeId); }
if (destinationId != null) { ids.add(destinationId); }
if (characteristicTypeId != null) { ids.add(characteristicTypeId); }
if (modifierId != null) { ids.add(modifierId); }
return ids.build();
}
}
| java |
A man from Gurugram has been arrested for faking his own kidnapping and demanding a ransom of Rs 2 lakh from his wife.
By India Today Web Desk: Gurugram police arrested a bartender for allegedly faking his own kidnapping and demanding a ransom to the tune of Rs 2 lakh from his wife to pay his debt. The accused, identified as Anoop Yadav, a resident of Rajiv Nagar in Gurugram, decided to stage a fake kidnapping as he was unable to pay off debts that he had taken from people.
The matter came to light when Yadav's wife filed a complaint against the kidnapping of her husband from Sector-29, reported news agency PTI. The complainant said that the kidnapper had asked her to pay a ransom of Rs 2 lakh for his release.
The abductor had sent a WhatsApp message to her, she claimed. Police lodged a case under 364-A of the Indian Penal Code (IPC) and launched an investigation.
With the help of technical surveillance and swift action, people nabbed the accused from IMT Chowk on the Delhi-Jaipur expressway on Monday. The accused confessed to his crime of faking his own abduction and asking ransom money from his wife upon interrogation.
Further probe revealed that the bartender works as a supervisor at a club and had sent WhatsApp messages to his wife about his abduction and ransom money. The report revealed that he had earlier taken loan from several people which was paid by his family. He asked his wife for money to pay off his debt.
SHO Anil Kumar told PTI that during interrogation, it was found that no one had abducted him.
"He himself had sent messages asking for his money," he said.
Police said that action will be taken against the man for misleading the cops, hatching a conspiracy and giving false information. | english |
<filename>resources/js/components/Register.js
import React, { Component } from "react";
import PropTypes from "prop-types";
import axios from "axios";
import { post } from "jquery";
import { Link } from "react-router-dom";
import {
Button,
Modal,
ModalHeader,
ModalBody,
ModalFooter,
Input,
Alert,
} from "reactstrap";
class Register extends Component {
constructor(props) {
super(props);
this.state = {
email: "",
username: "",
address: "",
phone: "",
password: "",
confirm_password: "",
err: null,
message: null,
};
}
handleChange = (e) => {
let name = e.target.name;
let value = e.target.value;
this.setState({
[name]: value,
});
};
watchPassword = () => {
var x = document.getElementById("confirm");
var y = document.getElementById("password");
if (x.type === "password") {
x.type = "text";
y.type = "text";
} else {
x.type = "password";
y.type = "password";
}
};
register = (e) => {
e.preventDefault();
if (this.state.password != this.state.confirm_password) {
let error = {
confirm: "Password does not match!",
};
this.setState({
err: error,
});
} else {
this.setState({
err: null,
});
let form = new FormData();
form.append("email", this.state.email);
form.append("username", this.state.username);
form.append("phone", this.state.phone);
form.append("password", <PASSWORD>);
form.append("address", this.state.address);
axios
.post("http://127.0.0.1:8000/api/register", form)
.then((reponse) => {
if (reponse.data.success == 1) {
alert("Register success!");
window.location.href = "http://localhost:8000/";
}
this.setState({
err: reponse.data.errors,
});
});
}
};
render() {
return (
<div id="logreg-forms">
<form onSubmit={this.register}>
<h1
className="h3 mb-3 font-weight-normal"
style={{ textAlign: "center" }}
>
<b>Đăng ký</b>
</h1>
{this.state.err != null && (
<Alert color="danger">{this.state.err.register}</Alert>
)}
<div className="input-group">
<input
type="email"
name="email"
id="inputEmail"
className="form-control"
onChange={this.handleChange}
placeholder="Email address"
/>
</div>
<br />
{this.state.err != null && (
<span className="text-danger">{this.state.err.email}</span>
)}
<div className="input-group">
<input
type="text"
name="username"
className="form-control"
onChange={this.handleChange}
placeholder="<NAME>"
/>
</div>
<br />
{this.state.err != null && (
<span className="text-danger">
{this.state.err.username}
</span>
)}
<div className="input-group">
<input
type="text"
name="address"
className="form-control"
onChange={this.handleChange}
placeholder="Address"
/>
</div>
<br />
{this.state.err != null && (
<span className="text-danger">
{this.state.err.address}
</span>
)}
<div className="input-group">
<input
type="phone"
name="phone"
className="form-control"
onChange={this.handleChange}
placeholder="Phone"
/>
</div>
<br />
{this.state.err != null && (
<span className="text-danger">{this.state.err.phone}</span>
)}
<div className="input-group">
<input
type="password"
name="password"
onChange={this.handleChange}
id="password"
className="form-control"
placeholder="Password"
/>
</div>
<br />
{this.state.err != null && (
<span className="text-danger">
{this.state.err.password}
</span>
)}
<input
type="password"
id="confirm"
name="confirm_password"
onChange={this.handleChange}
className="form-control"
placeholder="Confirm Password"
/>
<br />
{this.state.err != null && (
<span className="text-danger">
{this.state.err.confirm}
</span>
)}
<br />
<input type="checkbox" onClick={this.watchPassword} />
Show Password
<div className="input-group">
<button
className="btn btn-md btn-block submit btn-secondary"
type="submit"
>
<i className="fas fa-user-plus"></i> Đăng ký
</button>
</div>
<Link to="/">Back</Link>
</form>
</div>
);
}
}
export default Register;
| javascript |
Originally expected to be five-plus hours, the flight was shortened by bad weather. Still, Boeing calls the flight a success and says the Dreamliner performed as expected.
SEATTLE--It turns out that Boeing's 787 Dreamliner can land too.
Just three hours after taking off from Paine Field in Everett, Wash., for its first-ever flight, the 787 made a gentle landing in a pouring rain at Boeing Field here. It marked the completion of an extremely vital step for this long-delayed and keenly watched $10 billion project.
As has been well-chronicled, the 787 project has been delayed for more than two years. Boeing rolled out the plane to great fanfare on July 8, 2007--07/08/07--and promised that its first flight was just months away at that point. But structural problems, a machinists' strike, supply chain shortages and cost overruns have forced Boeing into one public delay after another.
But after the aerospace giant got the plane through an essential test last week--the so-called taxi test, in which the plane is sent rocketing down a runway at high speed in order to lift its landing gear off the ground--all systems appeared to be ready to go for the first flight.
And indeed, on Tuesday morning, at 10:28, in front of thousands of company employees and an impressive phalanx of press, the plane took off. And quickly disappeared into a very cloudy sky. That flight was originally expected to last for as much as five-and-a-half hours but was cut short by poor weather throughout the northern Washington state region.
At 1:33 p.m. Pacific time, the plane landed, just minutes after having appeared miles away in the completely overcast sky.
Befitting the public relations nature of Tuesday's developments--and the obvious opportunity for Boeing to pat itself on the back for finally crossing this important milestone--it came as no surprise when, minutes after the maiden 787 was pulled up directly in front of a giant tent where the press corps and countless Boeing employees were waiting, Scott Fancher, the 787 Dreamliner program's vice president and general manager said, "This is a day that changed the history of aviation" and that the 787 has become the "first truly all-new airplane in the 21st century."
Those statements had to do with the fact that the 787 is made from carbon fiber, becoming the first major commercial airliner to be made from composite materials.
Fancher also took the opportunity to claim that the successful flight was a "statement of our nation's competitiveness," a clear poke at Boeing's European arch-rival, Airbus.
During its three-hour-and five-minute flight, the 787 reached a height of about 15,000 feet and a top speed of 207 miles an hour. The pilots had to scuttle their original plan of flying out over eastern Washington state. Chief pilot Mike Carriker said that a scout plane had flown ahead of the 787 in order to check out the intended route but had determined the conditions there were too rough for the tests that Boeing had hoped to execute during the flight.
After the 787 was towed back in and parked in front of the tent, Carriker and co-pilot Randy Neville emerged, beaming. Carriker pumped his arms high above his head and the crowd cheered.
Back on the ground during a question-and-answer session, Carriker joked that, "I thought the landing was pretty good, I don't know about you." And Neville said that the flight had presented the two pilots with no surprises. "The airplane did exactly as we were expecting," Neville said.
Carriker explained that just the act of getting the 787 in the air had gone a long way toward answering diagnostic questions about the plane. "We figured out more things about this airplane in ten minutes of flying," he said, "than we have in probably the last 100 days."
And amplifying that point, Carriker said that once he and Neville were airborne, they had set out to execute a "very, very, very aggressive plan. In spite of the continuously descending cloud cover that forced the shortening of the flight time, they were able to complete about half of their intended tasks he said.
Still, the bad weather gave the pilots a chance to put the plane through some paces they had not intended until later in a testing program that could last as long as nine months before the planned delivery of the first 787 to All Nippon Airways in late 2010. Neville said that included flying in icy conditions and in strong turbulence.
And there were some very small victories, too.
"We even got to do a functional test of the windshield wipers," Carriker joked.
Asked when the second 787 test flight will be, Carriker said that today's plane--the first of six Dreamliners that have been built--was ready to head back up for another go. But he suggested it would be at least after the new year before the second flight.
| english |
import os
import glob
import importlib
import logging
from six import string_types
from jinja2 import DictLoader
import jsonschema
import nbconvert # noqa: F401
from ipypublish.utils import (
pathlib,
handle_error,
get_module_path,
read_file_from_directory,
read_file_from_module,
)
from ipypublish import export_plugins
from ipypublish import schema
from ipypublish.templates.create_template import create_template
_TEMPLATE_KEY = "new_template"
_EXPORT_SCHEMA_FILE = "export_config.schema.json"
_EXPORT_SCHEMA = None
logger = logging.getLogger("configuration")
def get_export_config_path(export_key, config_folder_paths=()):
# type (string, Tuple[str]) -> Union[string, None]
"""we search for a plugin name, which matches the supplied plugin name
"""
for name, jsonpath in iter_all_export_paths(config_folder_paths):
if name == export_key:
return pathlib.Path(jsonpath)
return None
def iter_all_export_paths(config_folder_paths=(), regex="*.json"):
"""we iterate through all json files in the
supplied plugin_folder_paths, and then in the `export_plugins` folder
"""
for plugin_folder_path in config_folder_paths:
for jsonpath in glob.glob(os.path.join(plugin_folder_path, regex)):
name = os.path.splitext(os.path.basename(jsonpath))[0]
yield name, pathlib.Path(jsonpath)
module_path = get_module_path(export_plugins)
for jsonpath in glob.glob(os.path.join(str(module_path), regex)):
name = os.path.splitext(os.path.basename(jsonpath))[0]
yield name, pathlib.Path(jsonpath)
def load_export_config(export_config_path):
"""load the export configuration"""
if isinstance(export_config_path, string_types):
export_config_path = pathlib.Path(export_config_path)
data = read_file_from_directory(
export_config_path.parent,
export_config_path.name,
"export configuration",
logger,
interp_ext=True,
)
# validate against schema
global _EXPORT_SCHEMA
if _EXPORT_SCHEMA is None:
# lazy load schema once
_EXPORT_SCHEMA = read_file_from_directory(
get_module_path(schema),
_EXPORT_SCHEMA_FILE,
"export configuration schema",
logger,
interp_ext=True,
)
try:
jsonschema.validate(data, _EXPORT_SCHEMA)
except jsonschema.ValidationError as err:
handle_error(
"validation of export config {} failed against {}: {}".format(
export_config_path, _EXPORT_SCHEMA_FILE, err.message
),
jsonschema.ValidationError,
logger=logger,
)
return data
def iter_all_export_infos(config_folder_paths=(), regex="*.json", get_mime=False):
"""iterate through all export configuration and yield a dict of info"""
for name, path in iter_all_export_paths(config_folder_paths, regex):
data = load_export_config(path)
info = dict(
[
("key", str(name)),
("class", data["exporter"]["class"]),
("path", str(path)),
("description", data["description"]),
]
)
if get_mime:
info["mime_type"] = create_exporter_cls(
data["exporter"]["class"]
).output_mimetype
yield info
def create_exporter_cls(class_str):
# type: (str) -> nbconvert.exporters.Exporter
"""dynamically load export class"""
export_class_path = class_str.split(".")
module_path = ".".join(export_class_path[0:-1])
class_name = export_class_path[-1]
try:
export_module = importlib.import_module(module_path)
except ModuleNotFoundError: # noqa: F821
handle_error(
"module {} containing exporter class {} not found".format(
module_path, class_name
),
ModuleNotFoundError,
logger=logger,
) # noqa: F821
if hasattr(export_module, class_name):
export_class = getattr(export_module, class_name)
else:
handle_error(
"module {} does not contain class {}".format(module_path, class_name),
ImportError,
logger=logger,
)
return export_class
def get_export_extension(export_config_path):
"""return the file extension of the exporter class"""
data = load_export_config(export_config_path)
exporter_cls = create_exporter_cls(data["exporter"]["class"])
return exporter_cls.file_extension
def str_to_jinja(template_str, template_key="jinja_template"):
return DictLoader({template_key: template_str})
def load_template(template_key, template_dict):
if template_dict is None:
return None
if "directory" in template_dict["outline"]:
outline_template = read_file_from_directory(
template_dict["outline"]["directory"],
template_dict["outline"]["file"],
"template outline",
logger,
interp_ext=False,
)
outline_name = "{0}/{1}".format(
template_dict["outline"]["directory"], template_dict["outline"]["file"]
)
else:
outline_template = read_file_from_module(
template_dict["outline"]["module"],
template_dict["outline"]["file"],
"template outline",
logger,
interp_ext=False,
)
outline_name = "{0}/{1}".format(
template_dict["outline"]["module"], template_dict["outline"]["file"]
)
segments = []
for snum, segment in enumerate(template_dict.get("segments", [])):
if "file" not in segment:
handle_error("'file' expected in segment {}".format(snum), KeyError, logger)
if "directory" in segment:
seg_data = read_file_from_directory(
segment["directory"],
segment["file"],
"template segment",
logger,
interp_ext=True,
)
elif "module" in segment:
seg_data = read_file_from_module(
segment["module"],
segment["file"],
"template segment",
logger,
interp_ext=True,
)
else:
handle_error(
"'directory' or 'module' expected in segment {}".format(snum),
KeyError,
logger,
)
segments.append(seg_data)
template_str = create_template(outline_template, outline_name, segments)
return str_to_jinja(template_str, template_key)
| python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.