content
stringlengths
7
2.61M
Assessment of Placental Extracellular Vesicles-Associated Fas Ligand and TNF-Related Apoptosis-Inducing Ligand in Pregnancies Complicated by Early and Late Onset Preeclampsia Preeclampsia (PE) is a hypertensive disorder that affects 28% of pregnancies and is one of the main causes of fetal, neonatal, and maternal mortality and morbidity worldwide. Although PE etiology and pathophysiology remain unknown, there is evidence that the hyperactivation of maternal immunity cells against placental cells triggers trophoblast cell apoptosis and death. It has also been reported that placenta-derived extracellular vesicles (EV) carry Fas ligand (FasL) and Tumor necrosis factor-related apoptosis-inducing ligand (TRAIL) and trigger apoptosis in Jurkat T cells. This study aimed to quantify and compare FasL and TRAIL expression in EV derived from cultures of placenta explants from women with PE (early versus late) and women with uncomplicated pregnancies. Also, the study assessed EV capacity to induce apoptosis in Jurkat T cells. The authors isolated EV from placenta explant cultures, quantified FasL and TRAIL using ELISA, and analyzed EV apoptosis-inducing capability by flow cytometry. Results showed increased FasL and TRAIL in EV derived from placenta of women with PE, and increased EV apoptosis-inducing capability in Jurkat T cells. These results offer supporting evidence that EV FasL and TRAIL play a role in the pathophysiology of PE. INTRODUCTION Preeclampsia (PE) is a hypertensive disorder of pregnancy with an impact on perinatal and maternal mortality and morbidity. According to the World Health Organization (WHO), maternal mortality due to such hypertensive disorders is 2.8% of pregnancies worldwide (). The mortality rate for PE in Latin America and the Caribbean is 26% (), and in Colombia 20-30% (). Also, one fourth of fetal and neonatal deceases worldwide is associated with PE (500,000 neonates per year). This multifactorial disease is of unknown pathophysiology. The evidence, though, suggests the placenta plays an important role in the development of the disease. Increased proliferation and fusion of the cytotrophoblast, abnormal/incomplete remodeling of uterine spiral arteries (UtA), failed trophoblastic invasion, abnormal placentation, placental insufficiency, and an increased release of placenta-derived factors and EV have been described. These EV would have proinflammatory, anti-angiogenic, prothrombotic, and apoptotic properties. It is possible that placental molecules and membrane particles released in maternal circulation play a role in the systemic inflammation, endothelial dysfunction, and multi-systemic involvement characteristic of PE (). Currently, there are two categories of PE: Early-onset PE (EO-PE) (gestation < 34 weeks), and late-onset PE (LO-PE) (gestation ≥ 34 weeks). The two sub-types seem to have different etiology, pathophysiology, phenotype, and prognosis (). The EO-PE apparently involves an abnormal placentation and incomplete/failed remodeling of UtA. This type of PE has a higher risk of maternal and fetal complications such as intrauterine growth restriction (IUGR). The LO-PE possibly arises from the interaction between an apparently normal placenta and a maternal susceptibility involving endothelial dysfunction (microvascular damage) that results in general vasoconstriction and reduction of blood flow to multiple organs (heart, kidney, brain). This type of PE has a lower rate of fetal involvement and fewer perinatal complications than EO-PE (). One of the principal mechanisms involved in PE development is apoptosis, associated with reduced/altered syncitiothrofoblast formation, abnormal UtA remodeling, increased proinflammatory cytokines, reduced maternal-fetal immune tolerance, and increased expression of apoptotic proteins such as FasL and TRAIL in placenta-released EV (). TRAIL is a type II membrane protein. This protein induces apoptosis in transformed cells and tumor cells, is expressed at a significant level in most normal tissues and has been implicated in processes of homeostasis, autoimmune suppression, immune surveillance, among others (). FasL is a type II membrane protein that triggers death signals by binding to its membrane receptor Fas (). This protein is involved in the development of organs and in the homeostasis of cells and tissues. It is expressed in activated and cytotoxic T lymphocytes, NK cells, neutrophils, and cells found in immune privileged sites such as the eye, brain, testes, and placenta (). It has been reported that FasL and TRAIL are expressed by trophoblast cells, which can induce apoptosis in activated lymphocytes and, therefore, provide a mechanism for the maternal immune privilege of the fetus, in addition to a regulation of placental homeostasis during trophoblastic invasion (Jerzak and Bischof, 2002). Different studies have shown that FasL is involved in the remodeling of the UtA and in the establishment of placental tolerance and immune privilege (), for its part, the participation of TRAIL in the remodeling of UtA, where Cytotrophoblast uses a TRAIL-dependent mechanism to induce smooth muscle cell death and is involved in vessel remodeling (). Our hypothesis was: there are differences between the amount of FasL and TRAIL in extracellular vesicles derived from culture of placental explants of pregnant women with uncomplicated pregnancy and pregnant women with diagnosis of EO-PE or LO-PE and these EVs are capable to induce apoptosis. This study aimed to assess the presence of FasL and TRAIL in EV released by the placentas of patients with EO-PE and LO-PE, and the apoptosis-inducing capability of those vesicleassociated proteins. Sample Collection This study was conducted in the Hospital Universitario San Ignacio (HUSI) from February to December, 2018. The samples were placentas of pregnant women with PE after cesarean section delivery (cases, n = 14). The study divided cases in 2 groups of 7 samples each: EO-PE (placentas from women diagnosed with PE that started at <34 week gestation) and LO-PE (placentas from women diagnosed with PE that started at ≥34 week gestation). Convenience sampling was performed. Preeclampsia was diagnosed as the American College of Obstetricians and Gynecologists (ACOG) (The American College of Obstetricians and Gynecologists, 2019) recommendations. Placentas of women with uncomplicated pregnancies and healthy newborns were included as controls (controls, n = 7). Women with diabetes, kidney disease, intrapartum infection, or pregnancy complications, such as gestational diabetes, chorioamnionitis, and premature rupture of membranes were excluded. The authors reviewed the clinical histories of candidates for the study to determine whether they fulfilled inclusion criteria. The authors then informed potential participants of the research project and obtained informed consent from those choosing to participate. The placentas taken from C-sections were stored in plastic containers at 4 C in the Pathology laboratory and processed within 12 h of collection. The Ethics Committee of the HUSI-Pontificia Universidad Javeriana Faculty of Medicine approved the project (FM-CIE-0410-17). All procedures were carried out according to the biosafety manual of the Human Genetics Institute and the HUSI. Human Chorionic Villous Xplants Cultures Each placental cotyledon was isolated using sterile dissection. The fetal and decidual tissues were removed, and blood from the interstitial space was washed out with 0.9% saline solution. Small fragments (explants) of approximately 0.5 m were cut out. Two 6-well polyethylene plates were used for each sample. Four explants were incubated for 24 h () in each well in 8 ml of fetal bovine serum-free DMEM media (Gibco BRL, Bethesda, MD, United States) at 37 C (5% CO 2 ). Culture viability was assessed using metabolic reduction of 3-(4,5-dimethylthiazol-2-ilo)-2,5-dypheniltetrazole bromide (MTT) (Sigma-Aldrich, St Louis, MO). Evaluation of culture cell function was by -hCG measurement by ELISA (Thermo Fisher Scientific Inc., Waltham, MA, United States). EV Collection After 24 h of incubation, the supernatant of explants culture was centrifuged at 4,000 g for 20 min. The pellet was used for another study, and the supernatant was ultra-centrifuged at 100,000 g for 100 min. The supernatant was discarded, and the pellet re-suspended in 8 ml of PBS 1X. After a second ultracentrifugation of the supernatant at 100,000 g for 90 min at 4 C, the supernatant was discarded, and the pellet again resuspended in 50 L of PBS 1X. The pellet was stored in 1.5 ml sterile vials at -20 C (). EV Quantification and Characterization Nanoparticles Tracking Analysis (NTA) For the NTA, a 2 ml pool was performed for EV samples. The diluted samples were loaded into the assembled sample chamber of a NanoSight NS300. The EV were brought into focus using the thumbprint region as a reference, and 60-s video images were acquired and analyzed with NanoSight NTA 3.4 software. The values obtained represent the mean and standard deviation of two replicate isolations. Western Blot The authors used Bradford colorimetric method (BIORAD) for total EV protein quantification. First, the standard curve was prepared, and then the samples loaded. EV protein lysates were resolved on Tris-Glycine SDS-PAGE and transferred to polyvinylidene difluoride (BIORAD) membranes. Membranes were incubated overnight in primary antibody CD63 (Invitrogen anti-CD63 catalog #10628D, diluted 1:500 per manufacturer instructions) at 4 C, washed three times with 0.1% TBST, incubated with secondary antibody (HRP-conjugated goat antimouse, Thermo Scientific, Pierce, 1:10,000) for 1 h at room temperature, washed three times and detected with enhanced chemiluminescence (Invitrogen) on CL-XPosure Film (Thermo Scientific, Pierce). In addition, IgG1 antibody was used as isotype control (Catalog # 02-6502; Invitrogen). EV Quantification by ELISA The ELISA ExoQuant TM Overall Exosome Capture and Quantification Assay Kit (BioVision, California) was used for EV quantification, following the manufacturer's protocol. VE FasL and TRAIL Quantification The EV FasL quantification used the ELISA Fas Ligand (APTL) Human Kit (Abcam, Cambridge, MA, United States). The EV TRAIL quantification used ELISA Human TRAIL/TNFSF10 (Tumor Necrosis Factor Related Apoptosis Inducing Ligand) Kit (Elabscience, Houston, Texas, United States). Manufacturer's instructions were followed in both cases. Apoptosis Induction The authors cultured 400,000 Jurkat T cells per well in 1 ml of RPMI-supplemented medium in three 12-well polyethylene plates. A 5mg/ml and 10 mg/ml EV protein concentration of 4 EV-sample pool from controls and from a 4 EV-sample pool from cases were added to Jurkat T cells. The samples were incubated at 37 C (5% CO 2 ) for 8 and 24 h. Each reading assessed negative controls (Jurkat T cells with no EV exposure) and positive controls (Jurkat T cells + 5% DMSO) (Hajighasemi and Tajik, 2017). The FlowTACS TM Apoptosis Detection Kit (Trevigen, Gaithersburg, MD, United States) was used to detect DNA fragmentation due to the apoptotic signaling cascade by flow cytometry in the BD FACSAria TM III sorter (BD Bioscience, San Jose, CA, United States), following the manufacturer's protocol. BDTM CompBeads were used to adjust the fluorescence signals and voltage for each detector. BDTM Cytometer Setup & Tracking Beads (CST) were used for daily evaluation of flow cytometer performance, also following the manufacturer's recommendations. Statistical Analysis The authors used the Mann-Whitney statistical test for a comparative analysis of demographic variables among groups. The Fisher exact test was used to compare categorical variables. The Mann-Whitney statistical test was also used to analyze differences in quantification of EV, EV total proteins, and EV FasL and TRAIL expression levels among groups. The tests were assessed with a 95% confidence level. Finally, flow cytometry was analyzed with the FlowJo v8 software, and a descriptive analysis was made of apoptosis percentage for each treatment. RESULTS There were statistically differences among cases and controls in newborn weight, gestational age at delivery, and blood pressure. Birth weight and gestational age at delivery were lower in cases, especially in EO-PE, compared to controls. The ratio of newborn weight/placenta weight was lower in EO-PE, compared to controls. As expected, gestational age at delivery was higher in LO-PE women compared to EO-PE women. Of the 14 pregnant women with PE, 8 (57.1%) presented PE severity criteria (blood pressure ≥ 160 mm Hg/ ≥ 110 mm Hg). In addition, 11 (78.5%) PE pregnant women had proteinuria as measured by urine protein/creatinine ratio ( Table 1). Results of the nanoparticle tracking analysis allowed determination of EV isolation (). The EV had an average size of 149.4 nm with standard deviation of 83.5 nm and concentration of 8.93e 8 ± 3.74e 7 particles/ml. Western blot for CD63 showed a ∼55 kDa band indicating the presence of EV enriched with exosomes in the process of isolation () (Figure 1). The EV quantification showed a lower amount in samples from EO-PE (median: 0.24 ug/ul) compared to controls (median: 4.75 ug/ul) and compared to LO-PE cases (median: 9.36 ug/ul). The total protein quantification showed no statistically significant differences among groups (control group median: 228.5 mg/ml; EO-PE group median: 2,223 mg/ml; LO-PE group median: 268.7 mg/ml). The proportion of total protein/EV was higher in the EO-PE (median: 1,639-fold) compared to controls (median: 7.88-fold) and compared to the LO-PE group (median: 24.27-fold) (Figures 1C,D,E). Conversely, analysis of apoptosis in the EV-treated Jurkat T cells showed a directly proportional relationship between EV concentration increase and apoptosis percentage, at 8 and at 24 h. There was a reduction, however, in the apoptosis percentage at 24 h, both in cases and in controls (Figure 3 and Supplementary Figures 1, 2). DISCUSSION Pregnant women with EO-PE had less favorable obstetric results with high blood pressure levels (severity criterion), premature deliveries (gestation ≤ 36 weeks), and low birth weights, compared to controls and to LO-PE pregnant women. This is consistent with previous studies (;). This study shows that placental explants from LO-PE pregnancies have a higher EV release in vitro. This phenomenon has been described by Dragovic et al., who reported an increased release of syncytiotrophoblast-derived EV in LO-PE patients and controls compared to those in non-pregnant women (). Several authors have found a significant increase of circulating exosomes in EO-PE women, possibly associated with abnormal placental development and reduced function (;;). Meanwhile, Marques et al. did not find significant differences in EV concentrations for PE patients and normotensive pregnant women (). Discrepancy between these results may be due to differences in the types of analyzed samples and the methods for EV isolation and identification (). Mitchell et al. propose that exosome release may reflect the placental function and metabolic status (). It has been reported that in LO-PE the problem arises from interaction between a presumably normal placenta and maternal factors plagued with endothelial dysfunction, making them susceptible to microvascular damage (). The increased exosome release we report in LO-PE placentas could be interesting and need more research, this finding might be related to a compensation mechanism that attempts to mitigate a pregestational endothelial dysfunction. Further studies are necessary to prove that hypothesis. It is important to note that EV release has been reported to increase with gestational age (), so differences in EV amounts between EO-PE and LO-PE may be due to gestational age. By contrast, assessment of the total proteins/EV proportion reveals an increase in the amount of total proteins per EV in EO-PE cases. This finding is consistent with some reports indicating an increased release of EV with altered molecular characteristics (mainly in the bioactive charge) during PE development. These altered characteristics may affect normal EV biological function (). The EV express sFlt-1 and endoglin that may contribute to endothelial dysfunction. The EV also express plasminogen-activator inhibitors (PAI-1/PAI-2) responsible for the high levels of fibrin deposition in the intervillous space and for the placental infarctions observed in PE. The PAI are also responsible for excessive oxidation that may amplify the EV inflammatory burden modifying STB proteins and lipids that are not proinflammatory. Some studies have shown the effect of placental-derived exosomes in the maternal immune modulation during pregnancy, partly through the expression of pro-apoptotic molecules as FasL and TRAIL (). FasL may induce the stimulation/activation of the vascular endothelium. FasL may also induce an altered trophoblastic apoptosis that would play a role in endothelial dysfunction, systemic inflammation, and hypertension (). Conversely, it has also been reported that FasL may induce apoptosis in activated lymphocytes as a mechanism of tolerance and immunological privilege (Jerzak and Bischof, 2002). FasL also plays a role in the UtA remodeling (). These mechanisms may be related to the EO-PE and the increased EV expression of FasL in EO-PE. Regarding TRAIL, this study shows an increased TRAIL/EV proportion in the EO-PE group. This increase may be a response to STB reduction or functional loss caused by the altered apoptosis process during PE (). It also may derive from the increased apoptosis induction in activated lymphocytes as a defense mechanism against fetal allograft rejection by the maternal immune system (). The apoptosis-inducing capability of the isolated EV was assessed using the TUNEL assay. Placental EV has been reported to induce apoptosis in T cells as an immunological tolerance mechanism. For that reason, this experimental model () used Jurkat T cells. Leukemic cells have been reported to express FasL on their surfaces, so they were also used in this model (). Previous in vitro studies have shown that EV from placenta and serum of healthy pregnant women induce a significant increase (3.38 fold) of Jurkat T cells apoptosis compared to EV isolated from the serum of non-pregnant women. Studies also show that apoptosis induction depends on the Fas/FasL complex (). Gupta et al. in turn, showed that EV derived from explants cultures of placentas from uncomplicated pregnancies may play a role in the response of activated T cells (EV reduce T-lymphocyte proliferation and production of IL-2 and IFN). Those authors, however, did not find apoptosis induction in the cells (). Results of the present study show that the isolated EV are capable of triggering apoptosis in Jurkat T cells in a concentration-dependent manner (). There is also a higher apoptosis induction by EV from placentas of women with PE. This may result from EV triggering higher protection for the fetoplacental unit from activated maternal immunecells (Nair and Salomon, 2018). The higher apoptosis induction may also result from the inhibition of T lymphocyte activation and prolipheration (). A higher EV apoptosis-inducing capability may suggest EV content regulation aiming for higher apoptosis in target cells (). On the other hand, analysis of apoptosis with different treatments at 8 h and 24 h shows a reduction in apoptosis percentage at 24 h. Zhang et al., working from studies reporting T lymphocyte phagocytic capacity, exposed Mycobacterium tuberculosis (H37Ra) to Jurkat T cells, noting some morphological changes in the Jurkat T cells (cytoskeleton remodeling, wrinkled cellular surfaces, pseudopodia formation) associated with the induction of a form of non-selective endocytosis named macropinocytosis ().The eventual phagocytic capacity of the Jurkat T cells may explain the reduction in the apoptotic cells percentage over time. This is the first study to evaluate EV FasL and TRAIL levels from placentas with EO-PE and LO-PE and to assess their apoptosis-inducing capability. The principal limitation of this study is the sample size. It is recommended to replicate methods used in this study with a larger sample. Unfortunately, it is not possible to establish with certainty the nature of the isolated EV. Their size corresponds to exosomes, and analysis revealed the presence of CD63, a principal exosome marker (). This marker, however, has also been found in other EV, such as micro-particles () and apoptotic bodies (). The results in this study would have been complemented by measurement of FasL and TRAIL expression in placentas. A limited number of samples was a weakness that kept the apoptosis essays from reaching conclusions at a statistically significant level and from comparing EO-PE and LO-PE. Unfortunately, no replicas of the apotosis induction experiments were possible, due to the availability of extracellular vesicle samples, for this reason it is recommended to carry out new studies to replicate these results. This study suggests that FasL and TRAIL molecules, present in EV and of placental origin, participate in the pathophysiology of EO-PE and LO-PE. Study results provide additional evidence of a possible role of EV in the immune tolerance regulation in normal pregnancy and in pathological conditions such as PE, probably also with participation of FasL and TRAIL. It is necessary to continue research on this subject to gain more knowledge. It will be important to precisely identify the immunological target cells and the molecular mechanisms involved. There is also a conundrum: Are other cell types, such as the maternal vascular endothelial cells, a target? If so, what is their possible role in PE? DATA AVAILABILITY STATEMENT The original contributions presented in the study are included in the article/Supplementary Material, further inquiries can be directed to the corresponding author/s. ETHICS STATEMENT The studies involving human participants were reviewed and approved by the Ethics Committee of Hospital Universitario San Ignacio-Faculty of Medicine of Pontificia Universidad Javeriana of Bogot, Colombia. The patients/participants provided their written informed consent to participate in this study. AUTHOR CONTRIBUTIONS PA-R and RG-R conceived, designed, planned, and supervised the experiments. SQ and AB supported the implementation of the apotosis and extracellular vesicle isolation experiment. CM-A and TG performed the experiments. MO-C and JS collected samples and data of patients. CM-A, PA-R, and RG-R processed and analyzed the data and drafted the manuscript. All authors provided critical feedback, contributed to the interpretation of the results, and approved the final manuscript.
def calculate_sum_pos( object_1, object_2): sum_pos = 0 if isinstance(object_1, tuple): sum_pos += object_1[-1] elif isinstance(object_1, Tree): sum_pos += object_1.data[-1] if isinstance(object_2, tuple): sum_pos += object_2[-1] elif isinstance(object_2, Tree): sum_pos += object_2.data[-1] return sum_pos
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-10-14 23:42 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('votes', '0001_initial'), ] operations = [ migrations.AddField( model_name='profile', name='added_by', field=models.GenericIPAddressField(blank=True, null=True), ), migrations.AddField( model_name='profile', name='linkedin_url', field=models.URLField(blank=True, null=True), ), migrations.AlterField( model_name='profile', name='name', field=models.CharField(max_length=150), ), ]
<reponame>room77/77up<gh_stars>1-10 // Copyright 2014 Room 77 Inc. // Author: <EMAIL> (<NAME>) // Single source to replace hardcoded office ip #include <arpa/inet.h> #include "base/common.h" #include "util/network/office.h" #include "util/network/dnslookup.h" FLAG_string(office_hostname, "gate.room77.com", "The hostname that maps to the office's IP"); FLAG_int(office_port, 80, "The port number used in DNS resolution for finding the office IP"); namespace util { string Office::ComputeOfficeIP() { string addr; string office_ip; if (!(DNSUtil::Instance().LookupHost( gFlag_office_hostname, gFlag_office_port, &addr))) { LOG(INFO) << "Unable to resolve office host: " << gFlag_office_hostname; office_ip = "-1"; } else { office_ip = inet_ntoa(((const struct sockaddr_in *) addr.c_str())->sin_addr); } return office_ip; } } // namespace util
<filename>vox.geometry/plane2.h // Copyright (c) 2022 <NAME> // // I am making my contributions/submissions to this project solely in my // personal capacity and am not conveying any rights to any intellectual // property of any third parties. #ifndef INCLUDE_VOX_PLANE2_H_ #define INCLUDE_VOX_PLANE2_H_ #include "surface2.h" namespace vox { //! //! \brief 2-D plane geometry. //! //! This class represents 2-D plane geometry which extends Surface2 by //! overriding surface-related queries. //! class Plane2 final : public Surface2 { public: class Builder; //! Plane normal. Vector2D normal = Vector2D(0, 1); //! Point that lies on the plane. Point2D point; //! Constructs a plane that crosses (0, 0) with surface normal (0, 1). Plane2(const Transform2D &transform = Transform2D(), bool isNormalFlipped = false); //! Constructs a plane that cross \p point with surface normal \p normal. Plane2(const Vector2D &normal, const Point2D &point, const Transform2D &transform = Transform2D(), bool isNormalFlipped = false); //! Copy constructor. Plane2(const Plane2 &other); //! Returns true if bounding box can be defined. bool isBounded() const override; //! Returns builder fox Plane2. static Builder builder(); private: Point2D closestPointLocal(const Point2D &otherPoint) const override; bool intersectsLocal(const Ray2D &ray) const override; BoundingBox2D boundingBoxLocal() const override; Vector2D closestNormalLocal(const Point2D &otherPoint) const override; SurfaceRayIntersection2 closestIntersectionLocal(const Ray2D &ray) const override; }; //! Shared pointer for the Plane2 type. using Plane2Ptr = std::shared_ptr<Plane2>; //! //! \brief Front-end to create Plane2 objects step by step. //! class Plane2::Builder final : public SurfaceBuilderBase2<Plane2::Builder> { public: //! Returns builder with plane normal. Builder &withNormal(const Vector2D &normal); //! Returns builder with point on the plane. Builder &withPoint(const Point2D &point); //! Builds Plane2. Plane2 build() const; //! Builds shared pointer of Plane2 instance. Plane2Ptr makeShared() const; private: Vector2D _normal{0, 1}; Point2D _point{0, 0}; }; } // namespace vox #endif // INCLUDE_VOX_PLANE2_H_
/*@ XOC Release License Copyright (c) 2013-2014, Alibaba Group, All rights reserved. <EMAIL> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name of the Su Zhenyu 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 "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. author: <NAME> @*/ #include "cominc.h" #include "if_opt.h" namespace xoc { //Recognize simple IF control flow node //only recog such as: // if (cond) // single_BB // else // single_BB // endif // or: // if (cond) // single_BB // endif static IF_TYPE get_simple_if_node_type(IRCFG * cfg, IRBB * bb) { ASSERTN(cfg && bb, ("requires cfg")); BBList succs; cfg->get_succs(succs, bb); //IF cond node only has two succs if (succs.get_elem_count() != 2) { return NOT_SIMP_IF; } //IF cond node can not been circle-self if (succs.get_head_nth(0) == bb || succs.get_head_nth(1) == bb) { return NOT_SIMP_IF; } //It should optimize the two verbose succs edge if (succs.get_head() == succs.get_next()) { return NOT_SIMP_IF; } IRBB * truebd = nullptr; IRBB * falsebd = nullptr; if (succs.get_head()->is_fallthrough() && BB_is_target(succs.get_next())) { truebd = succs.get_head(); falsebd = succs.get_next(); } else if (succs.get_head_nth(1)->is_fallthrough() && BB_is_target(succs.get_head())) { falsebd = succs.get_head(); truebd = succs.get_next(); } else { ASSERTN(0, ("illegal CFG")); } BBList succs_in_true; BBList succs_in_false; cfg->get_succs(succs_in_true, truebd); cfg->get_succs(succs_in_false, falsebd); //true body node only has one succs if (succs_in_true.get_elem_count() != 1) { return NOT_SIMP_IF; } //true body node can not been circle-self if (succs_in_true.get_head() == truebd) { return NOT_SIMP_IF; } //If succ of true body is false body, such as // if-stmt // | | // | true // | | // false(actually is endif block) if (succs_in_true.get_head() == falsebd) { return SIMP_IF_THEN_TYPE; } //false body node only has one succs if (succs_in_false.get_elem_count() != 1) { return NOT_SIMP_IF; } //false body node can not been circle-self if (succs_in_false.get_head() == falsebd) { return NOT_SIMP_IF; } //In the case of succ of true body is NOT false body, such as // if-stmt // | | // false true // | | // endif if (succs_in_true.get_head() == succs_in_false.get_head()) { return SIMP_IF_ELSE_TYPE; } return NOT_SIMP_IF; } //Perform if optimization bool IRCFG::if_opt(IRBB * bb) { IF_TYPE ift = NOT_SIMP_IF; if (NOT_SIMP_IF != (ift = get_simple_if_node_type(this, bb))) { //TODO: Do misc if-pass here... return false; } return false; } } //namespace xoc
<gh_stars>0 #include <string> #include <fstream> #include <deque> #include <vector> #include <iostream> void partTwo(std::vector<int>); //Part 1 only works with smaller numbers int main() { std::string line; std::ifstream file("06.txt"); std::vector<int> originalFishes = {}; while (std::getline(file, line, ',')) { originalFishes.push_back(std::stoi(line)); } std::vector<int> fishes = originalFishes; for (int i = 1; i <= 80; i++) { int fishSize = fishes.size(); for (int fishIndex = 0; fishIndex < fishSize; fishIndex++) { if (fishes[fishIndex] == 0) { fishes[fishIndex] = 6; fishes.push_back(8); } else { fishes[fishIndex] -= 1; } } } std::cout << "After " << 80 << " days there will be " << fishes.size() << " fishes" << std::endl; std::cout << "To run second part press enter:" << std::endl << std::endl; getchar(); partTwo(originalFishes); return 0; } void partTwo(std::vector<int> inp) { std::cout << inp.size(); std::vector<long long> fishes = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // Load initial values for (int i = 0; i < inp.size(); i++) { fishes[inp[i]]++; } // Iterate over days for (int i = 1; i <= 256; i++) { long long addFishCount = fishes[0]; std::rotate(fishes.begin(), fishes.begin() + 1, fishes.end()); fishes[6] += addFishCount; } std::cout << "After " << 256 << " days there will be "; long long sum = 0; for (int i = 0; i < fishes.size(); i++) { sum += fishes[i]; } std::cout << sum << " fishes" << std::endl; };
Learning-Aided Dynamic Access Control in MEC-Enabled Green IoT Networks: A Convolutional Reinforcement Learning Approach The ongoing growth of Internet of Things (IoT) traffic increasesthe emergence of Multi-Access Edge Computing (MEC), which can serve IoT devices to process edge missions properly. The power supply for IoT devices is addressed by energy harvesting (EH) technology. However, the energy arrival model obeys the unknown energy arrival process. In addition, due to the dynamical changes of network state, it is crucial to study the access control in the MEC-based green IoT system. In this paper, we propose an MEC-based access control strategy to maximize the system utility for the green IoT system, considering the spectral efficiency and the successful access ratio from the perspective of operators and users respectively. Specifically, we model the access control problem as a Constrained Markov Decision Process (CMDP), and develop a novel centralized reward-based experience replay deep convolutional Q network algorithm (RCQN) to attain the optimal access control for EH IoT devices. Additionally, to enrich the prior knowledge of access control strategy, we design a Long Short-Term Memory (LSTM) based energy prediction module to predict the energy state of IoT devices by learning the historical energy arrival information, whose output is taken as the state information of RCQN. Simulation results demonstrate that the proposed LSTM-based RCQN access control algorithm significantly improves the system utility with a proper reward design and training mechanism.
<filename>packages/cli/src/cli.ts import { build, GluegunToolbox } from "gluegun"; type Args = { [key: string]: unknown; }; export const run = async (argv: Args): Promise<GluegunToolbox> => { const cli = build("w3") .src(__dirname) .plugins(`${process.cwd()}/node_modules`, { matching: "w3-*", hidden: true }) .help() .create(); return await cli.run(argv); };
In Pennsylvania, the leader in the White House race attacked a GOP senator over his party’s candidate. Democratic advisers said to expect more of the same With just over two weeks until Election Day, Hillary Clinton is turning her attention to the congressional majorities that would bolster her agenda as president. Porn star Jessica Drake is 11th woman to allege Trump sexual misconduct Read more Campaigning in the battleground state of Pennsylvania on Saturday, with running mate Tim Kaine in tow, Clinton dedicated a significant portion of her speech to attacking someone other than Donald Trump. The Democratic nominee laid into Pat Toomey, a Republican senator who has declined to say if he will vote for his party’s nominee on 8 November. “He still refuses to stand up to Donald Trump,” Clinton told a crowd of roughly 1,800 in Pittsburgh. “A lot of Republicans have. They have had the grit and the guts to stand up and say, ‘He doesn’t represent me.’” Thus far, Clinton has made an explicit appeal to “thoughtful Republicans”, moderates and independents reluctant to support Trump’s candidacy. While she will still extend a hand to Republicans seeking refuge, it became clear this weekend that she will target vulnerable senators whose defeat could help form a Democratic majority. “As we’re traveling in these last 17 days, we’re going to be emphasizing the importance of electing Democrats down the ballot,” she told reporters aboard her campaign plane. Noting her support for Katie McGinty, the Democratic challenger to Toomey, Clinton added: “I will be doing the same as we go state to state, as will Tim [Kaine].” Clinton has expanded her lead over Trump, holding a roughly six-point advantage according to polling averages. But in Congress, Democrats are in competitive races. “I think in general you’re going to hear her do more of what she did [in Pennsylvania] in terms of trying to raise the stakes of the down-ballot races,” Brian Fallon, a spokesman for Clinton’s campaign, told the Guardian. “We want to continue to extend an open hand to those voters that traditionally vote Republican to cast their ballot for Hillary Clinton, but at the same time there’s a different strain within the Republican party that’s made the decision to go all in on backing Donald Trump because they don’t want to offend his core supporters. “They should be held accountable in two-and-a-half weeks, for having played a role in Trump’s rise and for standing by him even after he’s gone around and offended people and shown himself to be completely temperamentally unfit.” Such was the case made against Toomey at Taylor Allderdice high school in Pittsburgh. Running through Trump’s controversial statements – calling Mexican immigrants “rapists” and “killers”, questioning Barack Obama’s birth, picking a fight with the parents of an Iraq war hero, his behavior toward women – Clinton asked voters why their senator was still undecided. “How much more does Pat Toomey need to hear?” she said. “If he doesn’t have the courage to stand up to Donald Trump after all this, can you be sure he will have the courage to stand up for you when it counts?” She also lavished praise on McGinty, who is in a dead heat with Toomey. An aide to Clinton said to expect similar arguments against other vulnerable Republican senators, such as Kelly Ayotte of New Hampshire, Ron Johnson of Wisconsin and Marco Rubio of Florida. Democrats need to gain at least four seats to retake the Senate if Clinton wins, in which case Kaine would serve as a tiebreaker. Priorities USA, a pro-Clinton super pac, is investing in states including New Hampshire and Pennsylvania, planning to tie embattled Republicans to Trump. Ted Kwong, a spokesman for Toomey’s campaign, said Clinton’s speech was “further proof that hyper-partisan, ethically challenged Katie McGinty will be a rubber stamp for everything Hillary Clinton wants to do in Washington. “Pat Toomey has been and will continue to be an independent leader in the Senate on issues ranging from gun safety to ending Wall Street bailouts.” ‘We’ve been very fortunate’ Republican strategists concede that if Clinton’s lead grows, their hopes of holding on to the Senate will diminish. For a change in the House, which the Democrats lost in the 2010 midterms, 30 seats must fall. But any gain of seats would still empower Democrats to influence, if not obstruct, the agenda of House speaker Paul Ryan. Barack Obama, campaigning for Clinton, has amplified his own efforts to put Republicans in Congress on trial. The president has argued that the GOP created Trump by adopting extreme positions that have rendered the party unrecognizable from that which supported presidents George W Bush, George HW Bush and the revered Ronald Reagan. Trump looms large for Pennsylvania Republican tip-toeing around him Read more Clinton highlighted the fact that many Republicans have rebuked their nominee, choosing not to say all her opponents belong to the “Party of Trump”, as Obama has done. Fallon said the Clinton campaign would continue “to differentiate between those reasonable Republicans and independents that are willing to go beyond not just rejecting Trump but also supporting her”. “I think that we’ve been very fortunate,” he said, “and welcomed with open arms Republicans and independents that made the decision very early on that not only could they not support Donald Trump but that they believed that Hillary Clinton would make for a strong president.” Where there was synergy with Obama’s message, Fallon said, was in taking to task those who continue to stand by Trump. “Republicans are trying to localize their race and differentiate themselves from Trump with varying degrees of success,” Fallon said, adding that many such candidates were in key states for the presidential and Senate elections. “That’s where I think you’ll see us focus our efforts in terms of trying to hold those Republicans’ feet to the fire.”
Intuitive simulation method based on associative memory Creative computation is a new research field of computational intelligence, and Intuition plays an important role in creativity. The relationship between intuition, experience, association and stimuli is described in a quantitative way. The experience is achieved by Hebb's law. On the basis of the definition of mutation association, the process of intuition is modeled by Hopfield neural networks, crossover and mutation operators. The cognitive and computational models for simulating intuition are established. Finally, an example for rendering fractal graphs is given to show the efficiency of the methods presented here.
Student-focused assessment criteria: thinking through best practice Using results from a survey and focus groups with staff and students, I evaluate best practice for student-focused assessment criteria, including the value of specific assessment criteria, where and when students engage with criteria, the use of exemplars, how assessment criteria connect to feedback and the importance of bringing students more actively into the assessment process. I argue that we need to accept that many students are assessment motivated, and rather than work against this reality (which is rarely successful), we should instead consider how assessment can address student concerns of clarity and fairness while being more tied into learning.
package abi32_0_0.expo.interfaces.sensors.services; import abi32_0_0.expo.interfaces.sensors.SensorService; public interface RotationVectorSensorService extends SensorService { }
Effect of cyclic AMP on the intracellular degradation of newly synthesized collagen. Prostaglandin E1 and cholera toxin increased the intracellular levels of cyclic AMP of human lung fibroblasts. With prostaglandin E1, the increase in cyclic AMP occurred within 10 min followed by a decline to less than one-half of peak values in 6 h. With cholera toxin, the increase occurred within 60 min but the level of cyclic AMP remained increased for 6 h. Both agents caused a decrease in collagen production as expressed as the proportion of newly synthesized protein represented by collagen. The increase in cyclic AMP levels was accompanied by a marked increase in the proportion of newly synthesized collagen which was degraded intracellularly prior to secretion. Analysis of the degraded collagen showed it to be predominantly less than 1000 daltons in molecular mass, but still in peptide linkage. The data are consistent with the hypothesis that cyclic AMP levels in diploid fibroblasts regulate the amount of collagen produced by fibroblasts, at least in part, by modulating the level of intracellular collagen degradation.
Lost in the eulogies for Nelson Mandela is one inconvenient fact. Under current Canadian law, this iconic hero of South Africa’s liberation would be considered a terrorist. On his last trip to Canada, in November 2001, Nelson Mandela was awarded honorary citizenship. Had he visited two months later, after Canada’s new anti-terrorism laws were proclaimed, he could have been arrested for having once been involved in activities that harmed property or people and that were aimed at effecting political change, writes Thomas Walkom. ( TOM HANSON / THE CANADIAN PRESS file photo ) To remember this is not to diminish Mandela. He peacefully transformed a desperately divided apartheid state into a more-or-less united country. The extravagant eulogies that followed his death are well-deserved. But Mandela’s complicated history also underscores how crudely the post-9/11 world approaches what it calls terrorism. Article Continued Below Former U.S. president Bill Clinton once likened Mandela to India’s Mahatma Gandhi. Both were visionaries. But unlike Gandhi, Mandela was not averse to using violence. In 1961, he established an armed wing of the anti-apartheid African National Congress to wage war on the South African state. Modelled on Fidel Castro’s guerrilla forces in Cuba, MK, as it was known, sabotaged power stations, attacked military bases and engaged in the occasional car bombing. People died. Mandela was in jail for most of these operations. But he never renounced his decision to authorize violent resistance. Indeed, a few months before being elected South Africa’s first black president he formally lauded his old MK comrades for embodying the “fighting spirit of our people.” Armed resistance, he said in that 1993 speech, had once played a useful role in South Africa’s political dialectic. But the time had come to move from this “period of armed propaganda” into a new phase of peaceful negotiation. At the time, Canada’s government seemed to understand that the border between terrorism and freedom fighting was fuzzy, that sometimes armed struggle could act as a way station on the road to peace. Article Continued Below Mandela was welcomed to Canada, three times. On his last trip, in November 2001, he was awarded honorary citizenship. Yet had he come two months later, after Canada’s stiff new anti-terrorism laws were proclaimed, he could have been arrested for the crime of having once been involved in activities that harmed property or people and that were aimed at effecting political change. In the world of real politics, Mandela would never have faced such charges. By 2001, he was too famous. But other, less famous people have run afoul of the Canadian government’s overly broad use of terms such as terrorism or war crimes. Omar Khadr is one. Wounded at the age of 15 in a 2002 Afghanistan firefight, the Canadian citizen has spent his life since then in prison. Canada’s Conservative government calls Khadr a terrorist and murderer. The U.S. claims that his role in the death of an American soldier during battle was a war crime. But these labels rest on the U.S. insistence that any one who militarily opposed its 2001 invasion of Afghanistan was by definition, a war criminal, terrorist or both. George Galloway is another example. The British MP was denied entry to Canada in 2009 as a terror supporter because he had once delivered relief supplies to Hamas-controlled Gaza. There are other less well-known cases. My colleague, Nicholas Keung, reported on one this week when Ottawa’s privacy commissioner chided the government for tarring some failed refugee claimant as war criminals — without evidence. That followed a July ruling by the Supreme Court that overturned Ottawa’s decision to label a former Congolese diplomat as a war criminal and thus deny his refugee claim. War crimes have taken place in the Congo, the court said, but there was no evidence that the former diplomat had any role in them. Mandela would understand why such broad-brush definitions are inherently unfair. He himself was hard to pigeon-hole. Western leaders praised him lavishly. But he continued to support people and causes with which these leaders did not always agree — including Castro, former Libyan dictator Moammar Gadhafi and the Palestinians. At home, he was seen as a man of the people. Yet, as Carleton University political scientist and South African specialist Linda Freeman noted to me in an email, his economic policy “leaned toward the powerful rather than the poor.” And he knew that, while peace is always preferable, sometimes the downtrodden must make war to get there. Thomas Walkom's column appears Wednesday, Thursday and Saturday.
Adolf von Becker Biography Becker was born in Helsinki, where he began his artistic studies at the newly founded Finnish Art Society Drawing School; he also studied law. In 1853, he completed his law degree and became a trainee at the Court of Appeals in Turku. While there, he continued to make drawing expeditions into the countryside and made the acquaintance of Robert Wilhelm Ekman, who encouraged him to study at the Royal Danish Academy of Fine Arts. He took Ekman's advice and graduated there in 1856. In 1858, he received a recommendation to study with Thomas Couture in Paris, but was overwhelmed by the huge, cosmopolitan city and left to enroll at the Kunstakademie Düsseldorf instead. The course of study there proved to be disappointing, so he returned to Paris to try again. When Couture closed his teaching studios in 1860, Becker applied to and was accepted at the École des Beaux-Arts, where he studied with Felix-Joseph Barrias, Ernest Hébert, Leon Cogniet and Leon Bonnat. In 1864, he travelled to Spain on a scholarship and made copies of the Old Masters in Madrid. Later, he visited Italy and, on his return to France, he rented a studio outside Paris from Alfred Wahlberg, who he had met in Düsseldorf. In 1868, he returned to Finland to take a position at the University of Helsinki drawing school; replacing the late Magnus von Wright. He was appointed a Professor there in 1879. Private teacher Meanwhile, in 1872, he had started his own private drawing school, probably to make nude models available to his students. He was known as a very strict teacher, so this may have also been a way to gain more control over the curriculum. Studies there were, however, interrupted by his frequent travels. Among his best-known students were Helene Schjerfbeck, Elin Danielson-Gambogi, Helena Westermarck and Akseli Gallen-Kallela. As the 19th-Century drew to a close, he came under increasing criticism from the younger generation of artists for being too conservative. This came to a head at the Exposition Universelle in 1889, when the older generation, represented by Becker, Walter Runeberg and Berndt Lindholm, came into open confrontation with a younger faction led by Ville Vallgren and Albert Edelfelt. Soon after, disagreements developed between him and the Finnish Art Association and he began to exhibit independently. He retired from the University in 1892 and returned to Paris. As he grew older, he found the winters there a bit too cold, so he moved to Nice in 1904. He died while vacationing in Vevey, Switzerland, aged 78.
#!/usr/bin/env python #coding:utf-8 # Author : tuxpy # Email : <EMAIL> # Last modified : 2015-08-25 19:59:30 # Filename : coroutine.py # Description : import gevent from gevent import Greenlet, monkey from functools import wraps class Coroutine(Greenlet): def __init__(self, func, args = None, kwargs = None, callback = None): Greenlet.__init__(self) self._args = args or () self._kwargs = kwargs or {} self._callback = callback self._func = func def _run(self): error = None result = None try: result = self._func(*self._args, **self._kwargs) except Exception as e: error = e if self._callback: self._callback(result, error) def coroutine(func): @wraps(func) def wrap(*args, **kwargs): monkey.patch_all() callback = kwargs.pop('callback', None) _coroutine = Coroutine(func, args, kwargs, callback = callback) _coroutine.start() return wrap
Distracted While Reading? Changing to a Hard-to-Read Font Shields against the Effects of Environmental Noise and Speech on Text Memory The purpose of this study was to investigate the distractive effects of background speech, aircraft noise and road traffic noise on text memory and particularly to examine if displaying the texts in a hard-to-read font can shield against the detrimental effects of these types of background sounds. This issue was addressed in an experiment where 56 students read shorter texts about different classes of fictitious creatures (i.e., animals, fishes, birds, and dinosaurs) against a background of the aforementioned background sounds respectively and silence. For half of the participants the texts were displayed in an easy-to-read font (i.e., Times New Roman) and for the other half in a hard-to-read font (i.e., Haettenschweiler). The dependent measure was the proportion correct answers on the multiple-choice tests that followed each sound condition. Participants performance in the easy-to-read font condition was significantly impaired by all three background sound conditions compared to silence. In contrast, there were no effects of the three background sound conditions compared to silence in the hard-to-read font condition. These results suggest that an increase in task demandby displaying the text in a hard-to-read fontshields against various types of distracting background sounds by promoting a more steadfast locus-of-attention and by reducing the processing of background sound. INTRODUCTION People working in indoor environments (e.g., schools and offices) are often exposed to distracting sounds deriving both from within (e.g., background speech) and outside the building (e.g., aircraft noise or road traffic noise), which can be problematic as background sound generally has a negative impact on cognitive performance (Szalma and Hancock, 2011;). More specific, background speech has proven to be detrimental to performance on several office-related tasks including text memory (Banbury and Berry, 1997;), reading comprehension (;;), proofreading (;;Smith-Jackson and Klein, 2009), and writing (a). Moreover, environmental noise originating from aircrafts and road traffic has the potential to impair reading proficiency in children (e.g., ;Hygge, 2003;Boman, 2004;), as well as impairing text memory and attentional functions in adults Enmarker, 2004;Srqvist, 2010;). Thus, it is important to investigate simple solutions that can aid individuals to resist distraction from various types of sound. This study will use a reading task as a tool to test if increased task demand-by changing the font of the text to one that is harder to read-can shield against the detrimental effects of the aforementioned types of background sounds on text memory. According to the duplex-mechanism account of auditory distraction there are at least two distinct ways in which sound can disrupt task performance. One way is sound that interferes with the deliberate processing of the focal material (i.e., interference-by-process), and the other way is sound that diverts focus away from the focal task (i.e., attentional capture). From the interference-by-process view text memory is impaired by background speech because both the focal material (i.e., the text that is read) and background speech contain semantic information and therefore engage similar processes in the brain, which in turn harms task performance Marsh and Jones, 2011). As aircraft noise and road traffic noise do not contain semantic information the effect of these types of sound on text memory might instead be explained by the sounds' acoustical characteristics (e.g., frequency modulation, salience, and predictability) that potentiate attentional capture (Srqvist, 2010;). However, it seems to be possible to overcome distracting sound by inducing a higher degree of concentration on the focal task. Of particular interest to the current study, are experiments that have shown that an increase in task demand-e.g., by making the to-be-remembered items harder to perceive (i.e., sensory load), by increasing the amount of information that have to be kept in memory (i.e., working memory load), or by loading the visual field with information (i.e., perceptual load)-protects against attentional capture (;), attenuates semantic auditory distraction of free recall, shield visual-verbal task performance against background speech (a,b), reduces the neural processing of background tones (b), and reduces the awareness of a novel tone (Macdonald and Lavie, 2011). In two recent experiments, participants undertook either a proofreading task (a) or a prose memory task (b) against a background of silence or speech. In these two studies, task demand was manipulated by displaying the texts in different fonts; one that was an easy-to-read font (i.e., Times New Roman) and one that was a hard-to-read font (i.e., Haettenschweiler). Both experiments revealed an interaction between background sound condition and font type, such as detection of semantic/contextual errors in the proofreading task and recall on the prose memory task was impaired by background speech, but only when the texts were displayed in the easy-toread font. In contrast, there was no effect of background speech when the texts where displayed in the hard-to-read font. Also, participants scored significantly higher on the prose memory task in the presence of background speech when the text was displayed in a hard-to-read font compared to an easy-to-read font. Hence, by forcing participants to reach a higher degree of attentional engagement in the focal task (i.e., concentrate harder), by manipulating the readability of the text, task performance was shielded against distraction (Linnell and Caparos, 2013;Srqvist and Marsh, 2015). Arguably, the shielding effect arises because higher attentional engagement in the focal task leads to a more steadfast locus-of-attention () and to reduced processing of background sound (b;;). The shielding effect that increased task demand seems to have on distractibility () can thus be a way to overcome distraction from background sound. However, it is still unclear if this type of technique also would shield against the effects of environmental noise on text memory. Therefore, participants in the current study completed a reading task in the presence of four background sound conditions (i.e., silence, background speech, aircraft noise, and road traffic noise). Half of the participants read texts displayed in an easy-toread font (i.e., Times New Roman), and the other half read texts displayed in a hard-to-read font (i.e., Haettenschweiler). These two fonts were chosen based on previous experiments whereby the Haettenschweiler font have been judged to be more demanding and more difficult to read compared to the Times New Roman font (a,b). It was expected that background speech, aircraft noise and road traffic noise would impair text memory compared to silence, but only for participants in the easy-to-read font condition. There would be no effect of background sound condition in the hard-to-read font condition (i.e., an interaction between the background sound condition and the font condition). Based on the findings in Halin et al. (2014b) it was also expected that participants in the hardto-read font condition would score higher on the memory test in the background speech condition compared to participants in the easy-to-read font condition. In addition, participants answered questions on how tired, mentally exhausted and concentrated they were before and after the experimental session. This was asked to see if, the supposedly benefit of, a hard-to-read font would come with a cost, insofar that participants in the hard-toread font condition would feel more fatigued after the experiment compared to participants in the easy-to-read font condition. To summarize, this study aimed to (a) replicate that increased task demand (e.g., by displaying the text in a hard-to-read font) shields against the detrimental effects of background speech on text memory, (b) to investigate if an hard-to-read font also would shield against the effects of environmental noise on text memory, and (c) examining the effect that increased task demand (by changing the font of the text) has on self-reported fatigue (i.e., tiredness, mental fatigue, and concentration). Participants Fifty-six (29 women) Swedish students (mean age = 24.45 years, SD = 4.97) participated for a small honorarium. All reported normal hearing, normal or corrected-to-normal vision and Swedish as their native language. The study was conducted in accordance with the declaration of Helsinki and the ethical guidelines given by the American Psychological Association. All participants were adults and participated on informed consent. The experiment caused no harm to any party, no information that can be associated with individual participants has been made available to an external part, and no conflict of interest can be identified. Prior the experiment participants were told that the study investigated the effects of background sound on memory. Afterward participants were orally debriefed about the purpose of the study. Background Sound All verbal material in this experiment was in Swedish. The background speech comprised a recording of a conversation between a female speaker and a male speaker taking turns talking about mundane topics (e.g., recreational activities). The speech sound file was 5 min long and was adjusted to real speech level at 60 dB(A) L eq based on the recommendation of the measurement level method (i.e., all the silent parts of the speech signal is removed prior to calculating sound pressure level; IEC 60268-16, 2011). The aircraft noise consisted of a recording of an airborne airplane passing by. The passage took approximately 1 min and was repeated five times to create the 5 min long sound file. The road traffic noise consisted of a recording of a road crossing with varying traffic. The sound file was 75 s long and was repeated four times to create a 5 min long sound file. The sound pressure level of the aircraft noise and the road traffic noise were both adjusted to 60 dB(A) L eq. All sound files were adjusted by using the software Matlab. Text Memory Four memory tests were developed and all tests had a reading phase and a test phase. In each reading phase participants read four paragraphs (∼ 130 words each) about fictitious species (one species per paragraph). The four fictitious species described in a memory test belonged to the same class of creatures and there were different classes used in the four memory tests (i.e., animals, fishes, birds, and dinosaurs). Each paragraph stated information about specific features (e.g., "The Malang have a 17-22 cm long tail"), habits (e.g., "The Malang is active during the day") and habitats of a species (e.g., These animals mainly live in large bushes). The paragraphs were either displayed in the font Times New Roman (i.e., easy-to-read font condition) or the font Haettenschweiler (i.e., hard-to-read font condition; see Figure 1). All paragraphs were written with 12-point font size, the spacing between lines set to 1, and with the left and right margins evenly adjusted. A paragraph was displayed for 75 s before it was automatically replaced by a new paragraph. After the time was up for the last paragraph participants were requested to answer if they had read all four paragraphs. Thereafter the computer went on to the test phase. In each test phase participants were asked to answer 24 multiple-choice questions that had the same 5 fixed options for all questions depending on which class of creature FIGURE 1 | Illustration on how the text was displayed in the easy-to-read font and hard-to-read font conditions. they had read about . Participants were asked to select which of the five options was the correct answer to a question (e.g., Which animal has a 20 cm long tail). On 16 of the 24 questions options A to D were the correct answer (i.e., four correct answers for each of the options). The remaining eight questions had option E (i.e., None of the species) as the correct answer. On these questions a crucial piece of information was replaced with erroneous information: e.g., Which of the animals live in large trees? (i.e., in the text it says that the Malang lives in bushes). Each of the four species had two of these questions allocated to them. All questions were written in the Arial font and presented sequentially in the same fixed pseudo-randomly order for all participants. Each question was presented for 15 s before it was automatically replaced with the next question. Procedure and Design A within-between mixed experimental design was used with font as the between-participant factor (easy-to-read font vs. hard-toread font) and background sound as the within-participant factor (silence vs. background speech vs. aircraft noise vs. road traffic noise). At arrival, participants were randomly assigned to either of the two font conditions. Participants sat alone in a room in front of a computer screen. All instructions were presented on the computer and participants were instructed throughout the experiment to wear headphones and to ignore any sound. Next, participants answered a number of background questions (e.g., age and gender) and a short questionnaire of how tired, mentally exhausted and concentrated they were at the moment, by filling in a number between 1 to 9 that they felt best corresponded to their state of mind (e.g., 1 = not tired at all, 9 = very tired). Thereafter they undertook the four memory tests that were presented in the same fixed order for all participants . The presentation order of the four background sound conditions were counterbalanced between participants in the same way for both font conditions. RESULT Text Memory Only participants that followed task instructions and reported that they had read all paragraphs in the reading phase of the memory test were included in the analysis. As can been seen in Figure 2, performance on the memory test was impaired by background sound, but only for participants in the easyto-read font condition, not for participants in the hard-to-read font condition. This conclusion was supported by a mixed 2 (Font condition: easy-to-read font vs. hard-to-read font) 4 (Background sound condition: Silence vs. background speech vs. road traffic noise vs. aircraft noise) analysis of variance that revealed no main effect of font condition, F = 0.49, p = 0.489, 2 p = 0.009, but a significant main effect of background sound condition, F = 9.36, p < 0.001, 2 p = 0.15, and a significant interaction between the two factors, F = 4.46, p = 0.005, 2 p = 0.08. In the easy-to-read font FIGURE 2 | Participants' score on the reading task as the proportion of questions correctly answered across the four background conditions and the two font groups respectively. Error bar represents standard error of means. Self-Reported Fatigue Mean values on self-reported fatigue are presented in Table 1. Participants in the two font conditions did not differ from each other in how tired, mentally exhausted and concentrated they were prior to the experimental session. But, participants in both font conditions reported being more tired, more mentally exhausted and less concentrated afterward compared to how they felt before they started the experiment. A mixed 2 (Font condition: Easy-to-read font vs. hard-to-read font) 2 (Time: Before session vs. after session) multivariate analysis of variance on tiredness, mental exhaustion and concentration revealed no significant main effect of font condition, F = 0.23, = 0.99, p = 0.877, 2 p = 0.01, but a significant main effect of time F = 15.36, = 0.53, p < 0.001, 2 p = 0.47, and no interaction between the two factors, F = 0.32, = 0.98, p = 0.809, 2 p = 0.02. The univariate test revealed that participants in both font conditions reported being more tired, F = 28.86, p < 0.001, 2 p = 0.35, more mentally exhausted, F = 27.13, p < 0.001, 2 p = 0.33, and less concentrated after the experiment compared to prior the experiment, F = 30.57, p < 0.001, 2 p = 0.36. DISCUSSION The purpose of this study was to investigate if an increase in task demand could shield against the detrimental effects of background speech, aircraft noise, and road traffic noise on text memory. As hypothesized, text memory was impaired by all three background sound conditions compared to silence, but only in the easy-to-read font condition not in the hard-toread font condition. Also, participants in the hard-to-read font condition performed significantly better on the text memory test in the background speech condition compared to participants in the easy-to-read font condition. Moreover, the benefit of the hard-to-read font did not come with an additional cost insofar that participants in the two font conditions did not differ from each other in the magnitude of self-reported tiredness, mental exhaustion and lack of concentration before and after the experimental session. The results that a hard-to-read font shields against distraction from background speech on text memory, and that memory performance in the background speech condition was significantly better for participants in the hard-to-read font condition compared to the easy-to-read font condition, replicates the finding of Halin et al. (2014b). The result of the current study also extend the findings of a trade-off between higher task demand and auditory distraction (Macdonald and Lavie, 2011;b;;a,b;) to concern environmental noise (i.e., aircraft noise and road traffic noise). Thus, the main contribution of this paper is that it shows that it is possible to overcome distraction from various types of background sound while reading by increasing task demand. A simple way to Frontiers in Psychology | www.frontiersin.org achieve increased task demand is by changing the font of the text to one that is harder to read. Arguably, a hard-to-read font forces the reader to concentrate more on the text. The increased (attentional) engagement on the focal task gives the reader a more steadfast locus-of-attention (), and it reduces the processing of background sound (b;;) at the face of presentation of the distracting sound, and consequently, the reader is less distracted by background sound. A question that has engaged previous research is whether background speech is more detrimental to text memory than aircraft noise or road traffic noise (e.g., ;Enmarker, 2004;Srqvist, 2010;Saetrevik and Srqvist, 2015). In this study the lowest text memory score was found in the background speech condition when the text was displayed in the easy-to-read font (see Figure 2). This finding is in line with the result of Srqvist's study, wherein background speech was more harmful to prose memory than aircraft noise. Previous studies that have compared the effects of background speech and road traffic noise have found that both sounds impaired cued prose recall compared to silence, but that neither of the two sounds were more distracting than the other Enmarker, 2004). Yet, when text memory was tested with recognition questions (i.e., multiple-choice questions) there was only an effect of background speech in Enmarker's study, but there was no effect of sound in Hygge et al.'s study. In contrast, this study found an effect of both speech and environmental sound on text memory by using recognition questions. A major difference between this study and that of Hygge et al. and Enmarker was that they had composed the sounds to resemble each other's acoustical properties, which this study did not do. Hence, any differences in the magnitude of how distracting each sound was could be due to how the sounds were altered. Still, based on the assumption made by the interference-by-process view it would be expected that background speech is more detrimental to text memory than environmental sound. This because of the clash that occurs between the processes involved in the reading task and the automatically processing of the background speech (). Moreover, fMRI data indicates that different cognitive processes are activated when performing an updating task in presence of either background speech or aircraft noise, and that speech impairs the cognitive control function involved in updating information in working memory (Saetrevik and Srqvist, 2015). Given that updating is important to text processing (De ), the dissimilarity in how the sounds influences neural activity might explain why background speech was the most detrimental sound condition in the current experiment. Even though background speech stands out as the most distracting sound source compared to silence, the result of the current study suggests that environmental noises are also harmful to text memory. From an applied point of view this finding is important to consider because it highlights that both speech and environmental noise are potential distracters in environments where it is crucial to be able to remember written information (e.g., schools and offices). However, the question is how applicable it is to increase task demand on a text (e.g., by changing the font to one that is harder to read) while reading in a noisy real-life setting? When people are reading at work or in school they can do so for a longer period of time than was the case in this experiment (i.e., 5 min per text). Also, in daily life people often must recall what they read far longer from encoding than what participants did in this experiment where text memory was measured directly after reading. Further research is needed to investigate the long-term consequences of reading a text displayed in a hard-to-read font. Regarding both the impact habituation has on the shielding effect of a hard-to-read font, and if increased task demand also has positive long-term effects on text memory. Another important issue is whether increased task demand would lead to higher levels of arousal that combined with a noisy environment would impose an increased health risk to people (Andringa and Lanser, 2013). The result in this study on self-reported tiredness, mental fatigue and concentration showed that the hard-to-read font was not perceived as more mentally exhausting than the easy-to-read font, at least in the short duration of time it took to complete the current experiment (∼20 min). However, this study did not investigate the effects of increased task demand on annoyance or irritability, which also are factors that could impose a health risk to people, e.g., by producing physical and psychological stress (Ouis, 2001;Andringa and Lanser, 2013). These matters are important to further investigate in order to answer if increased task demand is a sustainable way to overcome auditory distraction outside of the laboratory. CONCLUSION This paper shows that a hard-to-read font, at least temporary, can boost concentration and shield against the detrimental effects of environmental noise and background speech on text memory. Hence, a simple alteration of the appearance of a text can help individuals that are reading in noisy environments to overcome auditory distraction. AUTHOR CONTRIBUTIONS The author confirms being the sole contributor of this work and approved it for publication. FUNDING This study was financially supported by a grant from Stiftelsen Riksbankens Jubileumsfond (P11-0617:1) and the writing of the paper was supported by a grant from the Swedish Research Council awarded to Patrik Srqvist. ACKNOWLEDGMENTS I want to thank Johan Odelius at the University of Lule for his help with the sound files.
#include<bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define take vll a(n);for (int i=0;i<n;i++){cin>>a[i];} #define fast ios_base::sync_with_stdio(false);cin.tie(NULL) #define endl "\n" #define memory_of_node (struct node *)malloc(sizeof(struct node)) #define vll vector<long long int> #define vpl vector<pair<ll,ll>> #define mp make_pair #define s second #define f first #define st(v) sort(v.begin(),v.end()) #define Y cout<<"YES"<<endl #define N cout<<"NO"<<endl #define SY cout<<"Yes"<<endl #define SN cout<<"No"<<endl #define rep(start,upto,increment) for(int j=start;j<upto;j+=increment) #define sz(a) a.size() ll vmax(vll v){ ll max=v[0]; ll j; for (j=0;j<v.size();j++){ if (v[j]>max){ max=v[j]; } } return (max); } ll vmin(vll v){ ll min=v[0]; ll j; for (j=0;j<v.size();j++){ if (v[j]<min){ min=v[j]; } } return (min); } void solve(){ ll n; cin>>n; take; vll answer[n]; rep(0,n,1){ ll k; for (k=0;k<a.size();k++){ answer[j].pb(a[k]); } ll min=a[0]; ll i=0; rep(0,a.size(),1){ if (min>a[j]){ min=a[j]; i=j; } } a.erase(a.begin()+i); } // rep(0,n,1){ // ll k; // for (k=0;k<answer[j].size();k++){ // cout<<answer[j][k]<<" "; // } // cout<<endl; // } ll mat[n][n]; memset(mat,0,sizeof(mat)); rep(0,n,1){ ll start=j; ll end=n-1-j; ll in=0; // cout<<start<<" "<<end<<endl; while (start<=n-1){ mat[start][in]=answer[j][in]; in++; start++; } } rep(0,n,1){ ll k; for (k=0;k<n;k++){ if (mat[j][k]!=0){ cout<<mat[j][k]<<" "; } } cout<<endl; } } int main(){ fast; ll t=1; // cin>>t; while (t--){ solve(); } return 0; }
Circular Economy: a Comparison Between the Case of Singapore and France Nowadays, due to the continuous developments in economies, various dilemmas are emerging, including energy demand, waste management, and greenhouse gas emissions (GHE). A promising approach to address these issues is a transition toward a circular economy (CE), and one of its successful approaches is the waste-to-energy (WTE). By exploiting WTE, there will be less demand for raw materials and resources. In this study, two developed countries, including France and Singapore, are evaluated based on their CE transition using the WTE method. Both countries are developing rapidly in terms of a successful CE. Reducing landfills as the major problem in Singapore is one of the most vital plans in their CE project. The planned target in Singapore is reducing landfill by 30% by 2030. Furthermore, Singapore aims for reaching a 70% recycling rate by 2050. On the other hand, the CE in France includes more comprehensive laws in four different sectors, such as production, consumption, waste management, and mobilizing actors. It is planned that by 2025, the recycling rate in France will reach 100%. A roadmap toward building a CE cannot be succeeded unless some practical strategies are developed for overcoming the encountered obstacles. The roadmap of both countries shows a specific milestone to reach a better CE, cleaner environment, and less use of natural resources. Most of the Singapore sustainable plans are planned to be caught by 2030, while France is trying to complete them by 2025. It should be noted that due to the current pandemic situation caused by COVID-19, there are some issues in implementing the obligations and plans thoroughly. Introduction Natural resources and raw materials are the physical foundation of the world, which are the initial requirements for the growing economy. However, most of these valuable resources eventually end up as waste materials. Hence, global waste management should be implemented to develop an economic material use model to stop the waste of materials and consuming them wisely (;Rezvani b;;Telega and Telega 2020). Developing a circular economy system (CES) provides sufficient management in handling the life cycle of raw materials and enables economic development which is lucrative for society, businesses, and the environment. Besides, a CES aims to end up the consumerism culture by keeping products, components, and materials at their highest utility and value. In other words, CES is based on repairing and recycling culture and produces energy from renewable sources, whereas in a linear economy, energy is achieved from finite resources (;MacArthur 2013). Figure 1 can help us to distinguish the differences between CE and linear economy (). Transition to a circular approach in the production systems leads to reducing the consumption of raw materials (Rezvani a), and as a result, greenhouse gas emission (GHE) and use of natural resources could be controlled within the specific territory. As an example, in France, when plastic bottles are produced from recycled materials, there will be a 70% decrease in CO 2 emission in the production process comparing to using virgin raw materials (de Sousa ). Establishing a circular economy (CE) is a must toward facing growing waste obstacles which is essential for both supply security and environmental perspectives, and it will lead to a sustainable and competitive economy. The purposes of a CE is (Domenech and Bahn-Walkowiak 2019): I. Maximizing the circulation of the valuable materials within the industry; II. Modifying the consumption customs and pay attention to recycles materials rather than raw materials; III. Lowering waste generation by reuse option and decline in producing hazardous components in the environment. To solve the growing energy demand, waste problems, and GHE globally, a viable method is developing a waste-toenergy (WTE) strategy. Indeed, turning waste into energy is a viable tool for a CE to maintaining the resources, product values, and services (). Moreover, several state-of-the-art WTE strategies being used currently are combustion, gasification, and anaerobic digestion (). Energy recovery from municipal solid wastes (MSW) can be established by using WTE technologies (). It should be noted that the basis of the CES is advantageous for both economic and environmentally friendly profits (Tukker 2015). In general, WTE systems consist of four different categories based on biotechnology utilization including physical, thermal, chemical, and biological (). Therefore, different methods have a common feature; in all of them, waste converts directly to energy such as heat or electricity or in the form of biofuel for other purposes such as transportation. In addition, other methods including bio-heating (), incineration (), andco-digestion (), have also been investigated for WTE technologies. The relationship between the CES and WTE supply chain and their impact on the environment is shown in Fig. 2. As can be seen in Fig. 2, both CE and WTE are promising solutions for resolving environmental and economic issues and addressing the resource scarcity crisis. In some studies, it is mentioned that the CES is based on 3R principles including Reduce, Reuse, and Recycle (), while later, 5R principles are encouraged by adding Recovery and Reclamation to the 3R principles (). Nowadays, a 10R approach is suggested as the state-of-the-art used for Singapore zero waste masterplan with five more additional principles including Refuse, Refurbish, Remanufacture, Repurpose, and Re-mine (). As WTE technologies are among the most promising approaches for energy generation from MSW, many European countries are implementing these strategies to overcome their waste problems. Among European countries, France is well-known for European leadership in WTE technologies. In addition, this country benefits from the experienced French policymakers who can provide a role model in climate-related matters in CES (). Since environmental impacts in WTE technologies are a crucial (). The implemented WTE technologies in France is incineration; therefore, the number of incineration plants in France is more than any other EU country (). However, regarding the sustainability of this approach and its environmental impacts, the policy actors made decisions for sustainable development strategies such as setting tax for incineration plants and preventing or recycling wastes. As a consequence, the number of incineration plants from 2001 to 2016 had been decreased from 140 to 131 (). In France, besides increasing the rate of recycling (Woodard 2021), the focus of WTE's new technologies is developing smaller incineration plants with high energy recovery in densely populated areas (Woodard 2021). The start of the Singapore waste management system goes back to the 1960s when the housing development guard prepared shelters for the inhabitants (). The approach for waste management in Singapore was incineration, and its waste collection and disposal system was efficient enough at that time (). Their first incineration plant, Tuas incineration plant, was completed in 1986 with 1700 t per day capacity. Besides this plant, there are three other plants in which unrecyclable wastes are incinerated (Fujii and Rohan 2019) and all of them send their produced ash to the Samakau landfill. The current WTE approach in Singapore, incineration, is not suitable at the current waste generation rate and hence, disposal of the ash product in this strategy itself is a significant issue. Lack of space in Samakau Landfill is a straightforward observation for the inefficiency of this WTE technology (Van ). Singapore plans are to establish a CE in which it can increase the incineration plants' capacity along with more recycling and minimizing carbon emissions from incineration (Siow and Lee 2020). This article is a case study for the CE in France and Singapore based on WTE technologies and provides comparisons between them in terms of development in CES. Firstly, the main human-made problems stemming from wrong throwaway cultural habits are described. Secondly, a transition from a linear economy toward a CE is explained, and, France and Singapore are evaluated in terms of CES. In the last section, the challenges and strategies for the future of CE are mentioned. While many studies have been conducted to assess the impacts of approaching a CES based on WTE technologies in Singapore, the lack of a comparative analysis between Singapore and other pioneer countries in this field such as France is still missing (;). Hence, it is an essential step in figuring out the optimum transition pathway for the specific context considering the experiences of the role model examples. Moreover, the COVID-19 pandemic has shown a great level of vulnerability of such plans for unpredicted events. As a result, a part of the discussion is dedicated to assessing the impacts of such issues toward the CES transition plans and the ways that can be used to address them with a specific focus on the COVID-19 pandemics. Our Throwaway Culture Our planet is our second house which directly affects our lives. One of the basic problems regarding waste management stem from the wrong cultural habits in each society. The correct waste separation and disposing of harmful trash in the environment are significant cultural problems. The current throwaway culture is defined as "take, make, disposal" which is based on the linear economy as shown in Fig. 1 (). This linear way of consumption is no longer viable due to the rapid growth of population and economy and requires to alter to a circular model (). To obtain a more efficient waste management system, it is required to ensure the efficient consumption of materials at all stages of their lifecycles. This life cycle is divided into two categories: before usage (extraction and production) and after usage (disposal and recycling) (). To this aim, a waste hierarchy is needed which shows the waste management options based on the desirable priority. The important steps of the new waste hierarchy are depicted in Fig. 3. CE in Singapore Historically, before the definition of the CE concept, Singapore has reduced its wastes by incineration. The first WTE incineration plant was built in 1979 with a cost of 130 million dollars. Incineration was a popular solution for the waste problem in Singapore due to up to 90% reduction in the waste volume (Hannon and Zaman 2018). However, there are environmental issues due to incineration which requires new actions. The Semakau area with an area of 350 ha was opened for landfilling of 200,000 t of solid waste and incineration ash in Singapore from 1999. This landfill was the first man-made offshore landfill. However, the environmental threats in Samakau have affected about 700 species of animals and plants (ZERO WASTE MASTERPLAN n.d.). In addition to the environmental issues, Samakau is the only place left for landfilling in Singapore (ZERO WASTE MASTERPLAN). Due to space limitation in Samakau landfill until 2035 and the pollution threat for animal and plant species, Singapore is forced to reduce the amount of waste sent to Samakau (ZERO WASTE MASTERPLAN). Hence, the time of flourishing a CE in Singapore was started. The year 2019 is regarded as the beginning of the zero waste masterplan in Singapore by decreasing the consumption rate through reusing and recycling (). The focus of the zero waste masterplan was defined on electronic, packaging, and food waste in 2019. In this plan, the 10R approach was used () and the target is reducing landfills by 30% by 2030. Therefore, the lifespan of the Samakau landfill can go beyond 2035, which was estimated until 2030 before the implementation of the masterplan (Chan 2016). In addition, there are new obligations for the collection and treatment of electronic and food wastes in Singapore (Abidin 2020) as shown below: Fig. 3 Comparison between traditional and new waste hierarchy 1. Mandatory packaging by 2020 2. Expanding the responsibility of producers for electronic waste by 2021 3. Mandatory treatment in food waste by 2024 4. Increasing the producer responsibilities for packaging, especially plastics by 2025 (Chan 2016) By means of these obligations within 50 years, Singapore can reach the target of 70% recycling, and landfilling and incineration can be decreased to a large proportion. Based on the represented information in Fig. 4, recycling in Singapore has increased from 54 to 58% from 2007 to 2010, which is a slight improvement. In the same years, the incineration and landfilling of wastes have decreased at a slight amount from 42 to 40% and 3% to 2%, respectively. However, waste management in Singapore has a target of 70% recycling within 50 years. However, in the COVID-19 coronavirus pandemic, these obligations were not considered. Some studies present cases for waste management in future pandemics because in these cases, it is needed to ensure a safe waste management system (). For better waste management during the pandemic, numerous priorities should be investigated in different sectors as shown in Fig. 5. Respecting the disposing, it should be ensured to prevent virus spread based on up-to-date standards. Another concerning factor is about workers involved in the waste collection. Besides ensuring the safety of the workers, the government should provide them selfinsurance and health care services. Last but not the least, informing and educating people about waste generation and collection, and its impacts on the virus spreading. By obeying these principles, we can get through COVID-19 and other pandemics in the future. The efforts of Singapore in implementing CE in recent years are worthy of mention. As an example, this country seeks ways to produce jet fuel by 2022 (). This fuel is made by converting waste materials such as liquefied waste plastic to renewable energy. Moreover, some other developments in treatment facilities such as transport infrastructure and industrial facilities, prepare Singapore for its zero waste and low-carbon emission strategies (). The zero waste framework in Singapore is shown in Fig. 6. The most important factor to establish a CE in all of its aspects is financial aids (). The Singapore zero waste program has two sections: legislation and policies from the government and zero waste incentives. Sustainable Singapore Blueprint and Resource Sustainable Bill are the policies toward the CE in Singapore. Resource Sustainable Bill policy was applied in 2019 for obligations about waste collection and their treatment (). Besides, there are some incentives toward a CE, such as government research grants. As an example, two million dollars is available for zero waste projects, and the National Environment Agency (NEA) practices to adopt a CE economy approach (). CE in France The early days of waste management in France goes back to the sixteenth century when king Francis I ordered the citizens to use a basket for collecting their waste (). The years after that time until the nineteenth century, the collected waste went to the landfills without recycling. In the twentieth century, because of the technological development and population growth, a waste management program was developed by the Royal Act in 1992 (Hugo 14 juillet 1992). Due to the obligations of the Royal Art, the rate of waste storage in France decreased from 43% in the 2000s to 26% in 2013 (). As shown in Fig. 7, organic recovery increased from 53 to 73% between 2000 to 2013, and also, incineration as a way of WTE technology increased in this period. The CE in France is based on the targets of the Agenda 2030 Sustainable Development Goals (SDGs) (), and its aim is increasing waste valorization to 70% weight by 2020 and developing a CE through a Construction and Demolition (C&D) management for recycling and reusing. The CE framework in France was established on August 17, 2015, by the French parliament (Liszka and Walawender 2018) as shown in Fig. 8. The patterns toward a CE in France have changed their consumption culture. CE valuable goals are in progress in France, such as eco-design for electrical appliances and products, recyclability, the capability of repairing and reusing (). The recycling rate in France has increased from 35.3 to 42.9% between 2009 and 2017 (https:// www.citeo.com/). Based on Citeo reports, about 70.3% of MSW was recycled in 2019 which is 3.361 million tonnes, but still, 29% of plastic wastes were not recycled ( Fig. 9) (https://www.citeo.com/). The France government knows the importance of the CE in waste management, and hence a real roadmap is proposed to better management. In this roadmap, the goal is achieving 100% recycling by 2025 (). The roadmap for a CE in France has some objectives, which should be focused on. I. Consumption of natural resources for human needs should be decreased to 30% in 2030, in comparison with the GPD in 2010. II. Landfills should be emptied of non-hazardous waste to 50% by 2050, comparing to 2010. III. 100% of plastics should be recycled by 2050. IV. Preventing GHE from plastic recycling. V. Creating 300,000 additional jobs in the way to developing a CE. The France CE framework is fully described in Fig. 10. Challenges and Strategies for Achieving CE Goals Our way to a fully zero waste masterplan is very long to go, but it needs a strong start. In transition toward a CE rather than linear economy, we face numerous challenges. Some of these challenges are climate change, rising consumption because of the global population growth, rapid urbanization and development of cities, and insufficient space for landfills. By studying the Singapore and France cases, we found out that both have opportunities to develop a CE through their growing ambitions and initiatives toward sustainable development. In Table 1, both countries are evaluated based on the CCAF (Circular City Analysis Framework) indicators in 2019. Based on the given data about the energy consumption in France and Singapore, using renewable energy in France has by far higher records. Also, electricity production in France is 584 (TW); however, this is 13,667 (MW) in Singapore. In the economic factor, France has more progression because of the high rate of GDP. There is not any budget for implementing a circular economy in Singapore; however, in France, roughly 9000 € is considered for CE plans. Using public transportation in France is 327 times more than in Singapore. In the waste management dimension, the incineration record is approximately similar in both countries but, the recycling rate in France is by far more than Singapore. Although, landfilling in France is negligible in comparison with Singapore, which is about 3 million. The records in other dimensions such as water management, education, and technology are high in both countries. In the social sector, there are contrasting pieces of information. For overcoming the challenges and facilitate CE development at a micro-level, a circular hub can be established. This physical location can enable startups and concepts for inventing new technologies for making a CE. Another strategy is conducting more research experiments in the CE approach for main aspects including food, energy, mobility, housing and infrastructure, water, consumer goods, plastics, and industrial parks (Jackson 2018). These researches can make a model for other cities to achieve sustainable Fig. 9 The recycling rate of different materials in France in 2019 Fig. 10 France roadmap for a CE development goals. In addition, the efforts of the government by setting incentives and grants toward a CE program is inevitable. Furthermore, there was an attempt to build new resiliences, climate resilience, resource resilience to addressing the status of resources, and economic stability for granting the plans. There is an urgent need for waste recycling as the recycled materials can be used as the resources for production in factories, not from the scratch. One of the most promising methods for building a CE is setting ambitious targets as mentioned above for both France and Singapore. Moreover, we need to produce more efficient and re-engineered products with fewer materials and energies. By setting strict boundaries for the consumption of resources, a national consciousness toward environmental care can be built. Moreover, France practices toward a CE are worth mentioning; Green public procurement (GPP) encourages customers to the green purchasing behavior, which is less damaging to the environment (). The zero waste masterplan is beneficial for both consumers and producers. A citizen workgroup for improvement in household recycling in Singapore () and developing an eco-industrial park in France () are some of these plans. One important fact is that we should start waste management from ourselves, this behavior should be taught in schools, universities, and through the media to all generations of a society. Furthermore, we cannot tackle the waste problem, unless we manage our waste and used materials. Some of our efforts as a community to deal with waste management is listed below: Conclusion and Future Perspective This article represents a case study about the waste management system, for Singapore and France along with plans for developing a CE in both nations. The used approach in this article is WTE. Studying the CE in Singapore and France represents that in both countries waste management has been started and planned comprehensively. The road map for a circular city is legislated in both countries which includes long-term plans. The rate of recycling in France is faster than in Singapore and it is estimated that in 2025, the recycling percent in France will reach 100%, while in Singapore it is estimated to catch 70% in 2050. Although, a transition toward a zero waste masterplan is in progress, recently due to pandemic COVID-19 some of the Resource Sustainability Bill obligations are not considered carefully. Despite the developments toward CE in Singapore, like the jet fuel program and inventing new facilities by 2022, most of the plans are in progress until 2030. In the case of France, the targets of increasing waste recycling to 100% and developing a CE for preventing landfilling is in progress until 2025. Furthermore, France has got through landfilling problems and this country is now encouraging customers and businesses into green purchasing and manufacturing systems to control the negative effect of waste. On the other hand, Singapore still has problems in the storage of waste materials in landfills and had not significant developments in green manufacturing. Regarding climate change in the world and to maintain a sustainable economy in Europe, European Green Deal (EGD) was developed. The purpose of EGD is to achieve a modern and resource-efficient economy through three concrete action plans, by 2050; climate neutrality, investment bank, and sustainable investment plan. Some of the long-term incentives in this strategy include zero-emission, affordable secure energy, smarter transport, high-quality food, and better quality of life. However, in Singapore NCCS (National Climate Change Secretariat) and NDC (Nationally Determined Contribution) organizations develop plans for a sustainable economy. Moreover, some of the main goals of these organizations are as follow: introduce a carbon tax for businesses and other large carbon emitters, developing low-carbon technologies such as solar energy and other renewable sources, using power grids and solar photovoltaic systems, improving energy efficiency by motivating businesses, manufacturing electric vehicles, and introducing nuclear power plants. There are some challenges toward building a CE, but with some long-term strategies, the dream of becoming a CE can become into reality. As the main drivers for moving toward building a CE, are global measures such as decoupling the economic growth, decreasing the level of emissions, and energy transition toward a sustainable supply system, it is necessary to assess the impact of national-level plans and scenarios in a global context, not just looking at a single country. While such a comprehensive qualitative analysis is still missed, the following study will provide a ground for it for future studies. Compliance with Ethical Standards Conflict of Interest The authors declare that they have no conflict of interest.
<filename>src/watson/cli/HighlightCommand.java package watson.cli; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import watson.chat.Chat; import watson.chat.ChatHighlighter; // -------------------------------------------------------------------------- /** * The Watson /hl command. */ public class HighlightCommand extends WatsonCommandBase { // -------------------------------------------------------------------------- /** * @see net.minecraft.src.ICommand#getCommandName() */ @Override public String getCommandName() { return "hl"; } // -------------------------------------------------------------------------- /** * @see net.minecraft.src.ICommand#processCommand(net.minecraft.src.ICommandSender, * java.lang.String[]) */ @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { ChatHighlighter highlighter = Chat.getChatHighlighter(); if (args.length == 0) { help(sender); return; } else if (args.length == 1) { if (args[0].equals("help")) { help(sender); return; } else if (args[0].equals("list")) { highlighter.listHighlights(); return; } } else if (args.length == 2) { if (args[0].equals("remove")) { int index = parseInt(args[1], 1); highlighter.removeHighlight(index); return; } } else if (args.length >= 3) { if (args[0].equals("add") || args[0].equals("select")) { // Allow patterns to contain spaces, rather than requiring \s. StringBuilder pattern = new StringBuilder(); for (int i = 2; i < args.length; ++i) { pattern.append(args[i]); if (i < args.length - 1) { pattern.append(' '); } } highlighter.addHighlight(args[1], pattern.toString(), args[0].equals("select")); return; } } localError(sender, "Invalid command syntax."); } // processCommand // -------------------------------------------------------------------------- /** * Show a help message. */ public void help(ICommandSender sender) { localOutput(sender, "Usage:"); localOutput(sender, " /hl help"); localOutput(sender, " /hl add <colour> <pattern>"); localOutput(sender, " /hl list"); localOutput(sender, " /hl remove <number>"); localOutput(sender, "Documentation: http://github.com/totemo/watson"); } } // class HighlightCommand
/// Makes a copy of this set of streams, but with all streams copied with their states set to /// idle. pub fn as_new(&self) -> Self { let mut streams = HashMap::new(); for (id, stream) in self.streams.iter() { streams.insert(id.clone(), stream.as_new()); } Self { streams, ..Default::default() } }
/* * This file is generated by jOOQ. */ package cn.vertxup.fm.domain.tables; import cn.vertxup.fm.domain.Db; import cn.vertxup.fm.domain.Indexes; import cn.vertxup.fm.domain.Keys; import cn.vertxup.fm.domain.tables.records.FBookRecord; import org.jooq.*; import org.jooq.impl.DSL; import org.jooq.impl.TableImpl; import javax.annotation.Generated; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; /** * This class is generated by jOOQ. */ @Generated( value = { "http://www.jooq.org", "jOOQ version:3.10.8" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({"all", "unchecked", "rawtypes"}) public class FBook extends TableImpl<FBookRecord> { /** * The reference instance of <code>DB_ETERNAL.F_BOOK</code> */ public static final FBook F_BOOK = new FBook(); private static final long serialVersionUID = -168805129; /** * The column <code>DB_ETERNAL.F_BOOK.KEY</code>. 「key」- 账本主键ID */ public final TableField<FBookRecord, String> KEY = createField("KEY", org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, "「key」- 账本主键ID"); /** * The column <code>DB_ETERNAL.F_BOOK.NAME</code>. 「name」 - 账本名称 */ public final TableField<FBookRecord, String> NAME = createField("NAME", org.jooq.impl.SQLDataType.VARCHAR(255), this, "「name」 - 账本名称"); /** * The column <code>DB_ETERNAL.F_BOOK.CODE</code>. 「code」 - 账本的系统编号 */ public final TableField<FBookRecord, String> CODE = createField("CODE", org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, "「code」 - 账本的系统编号"); /** * The column <code>DB_ETERNAL.F_BOOK.SERIAL</code>. 「serial」 - 财务系统账本编号 */ public final TableField<FBookRecord, String> SERIAL = createField("SERIAL", org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, "「serial」 - 财务系统账本编号"); /** * The column <code>DB_ETERNAL.F_BOOK.TYPE</code>. 「type」 - 账本类型 */ public final TableField<FBookRecord, String> TYPE = createField("TYPE", org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, "「type」 - 账本类型"); /** * The column <code>DB_ETERNAL.F_BOOK.MAJOR</code>. 「major」- 主账本标识 */ public final TableField<FBookRecord, Boolean> MAJOR = createField("MAJOR", org.jooq.impl.SQLDataType.BIT, this, "「major」- 主账本标识"); /** * The column <code>DB_ETERNAL.F_BOOK.AMOUNT</code>. 「amount」- 交易金额,正数:应收,负数:应退,最终计算总金额 */ public final TableField<FBookRecord, BigDecimal> AMOUNT = createField("AMOUNT", org.jooq.impl.SQLDataType.DECIMAL(18, 2).nullable(false), this, "「amount」- 交易金额,正数:应收,负数:应退,最终计算总金额"); /** * The column <code>DB_ETERNAL.F_BOOK.COMMENT</code>. 「comment」 - 账本备注 */ public final TableField<FBookRecord, String> COMMENT = createField("COMMENT", org.jooq.impl.SQLDataType.CLOB, this, "「comment」 - 账本备注"); /** * The column <code>DB_ETERNAL.F_BOOK.CHECKED</code>. 「checked」- 是否检查 */ public final TableField<FBookRecord, Boolean> CHECKED = createField("CHECKED", org.jooq.impl.SQLDataType.BIT, this, "「checked」- 是否检查"); /** * The column <code>DB_ETERNAL.F_BOOK.CHECKED_DESC</code>. 「checkedDesc」 - 账本检查描述信息 */ public final TableField<FBookRecord, String> CHECKED_DESC = createField("CHECKED_DESC", org.jooq.impl.SQLDataType.CLOB, this, "「checkedDesc」 - 账本检查描述信息"); /** * The column <code>DB_ETERNAL.F_BOOK.EXCEED</code>. 「exceed」- 是否加收 */ public final TableField<FBookRecord, Boolean> EXCEED = createField("EXCEED", org.jooq.impl.SQLDataType.BIT, this, "「exceed」- 是否加收"); /** * The column <code>DB_ETERNAL.F_BOOK.EXCEED_DESC</code>. 「exceedDesc」 - 账本加收描述信息 */ public final TableField<FBookRecord, String> EXCEED_DESC = createField("EXCEED_DESC", org.jooq.impl.SQLDataType.CLOB, this, "「exceedDesc」 - 账本加收描述信息"); /** * The column <code>DB_ETERNAL.F_BOOK.PRE_AUTHORIZE_ID</code>. 「preAuthorizeId」- 关联预授权 */ public final TableField<FBookRecord, String> PRE_AUTHORIZE_ID = createField("PRE_AUTHORIZE_ID", org.jooq.impl.SQLDataType.VARCHAR(36), this, "「preAuthorizeId」- 关联预授权"); /** * The column <code>DB_ETERNAL.F_BOOK.PRE_AUTHORIZE</code>. 「preAuthorize」- 是否预授权 */ public final TableField<FBookRecord, Boolean> PRE_AUTHORIZE = createField("PRE_AUTHORIZE", org.jooq.impl.SQLDataType.BIT, this, "「preAuthorize」- 是否预授权"); /** * The column <code>DB_ETERNAL.F_BOOK.PRE_AUTHORIZE_DESC</code>. 「preAuthorizeDesc」 - 预授权描述信息 */ public final TableField<FBookRecord, String> PRE_AUTHORIZE_DESC = createField("PRE_AUTHORIZE_DESC", org.jooq.impl.SQLDataType.CLOB, this, "「preAuthorizeDesc」 - 预授权描述信息"); /** * The column <code>DB_ETERNAL.F_BOOK.MODEL_ID</code>. 「modelId」- 关联的模型identifier,用于描述 */ public final TableField<FBookRecord, String> MODEL_ID = createField("MODEL_ID", org.jooq.impl.SQLDataType.VARCHAR(255), this, "「modelId」- 关联的模型identifier,用于描述"); /** * The column <code>DB_ETERNAL.F_BOOK.MODEL_KEY</code>. 「modelKey」- 关联的模型记录ID,用于描述哪一个Model中的记录 */ public final TableField<FBookRecord, String> MODEL_KEY = createField("MODEL_KEY", org.jooq.impl.SQLDataType.VARCHAR(36), this, "「modelKey」- 关联的模型记录ID,用于描述哪一个Model中的记录"); /** * The column <code>DB_ETERNAL.F_BOOK.PARENT_ID</code>. 「parentId」- 子账本专用,引用父账本ID */ public final TableField<FBookRecord, String> PARENT_ID = createField("PARENT_ID", org.jooq.impl.SQLDataType.VARCHAR(36), this, "「parentId」- 子账本专用,引用父账本ID"); /** * The column <code>DB_ETERNAL.F_BOOK.ORDER_ID</code>. 「orderId」- 订单对应的订单ID */ public final TableField<FBookRecord, String> ORDER_ID = createField("ORDER_ID", org.jooq.impl.SQLDataType.VARCHAR(36), this, "「orderId」- 订单对应的订单ID"); /** * The column <code>DB_ETERNAL.F_BOOK.SIGMA</code>. 「sigma」- 统一标识 */ public final TableField<FBookRecord, String> SIGMA = createField("SIGMA", org.jooq.impl.SQLDataType.VARCHAR(32), this, "「sigma」- 统一标识"); /** * The column <code>DB_ETERNAL.F_BOOK.LANGUAGE</code>. 「language」- 使用的语言 */ public final TableField<FBookRecord, String> LANGUAGE = createField("LANGUAGE", org.jooq.impl.SQLDataType.VARCHAR(10), this, "「language」- 使用的语言"); /** * The column <code>DB_ETERNAL.F_BOOK.ACTIVE</code>. 「active」- 是否启用 */ public final TableField<FBookRecord, Boolean> ACTIVE = createField("ACTIVE", org.jooq.impl.SQLDataType.BIT, this, "「active」- 是否启用"); /** * The column <code>DB_ETERNAL.F_BOOK.METADATA</code>. 「metadata」- 附加配置数据 */ public final TableField<FBookRecord, String> METADATA = createField("METADATA", org.jooq.impl.SQLDataType.CLOB, this, "「metadata」- 附加配置数据"); /** * The column <code>DB_ETERNAL.F_BOOK.CREATED_AT</code>. 「createdAt」- 创建时间 */ public final TableField<FBookRecord, LocalDateTime> CREATED_AT = createField("CREATED_AT", org.jooq.impl.SQLDataType.LOCALDATETIME, this, "「createdAt」- 创建时间"); /** * The column <code>DB_ETERNAL.F_BOOK.CREATED_BY</code>. 「createdBy」- 创建人 */ public final TableField<FBookRecord, String> CREATED_BY = createField("CREATED_BY", org.jooq.impl.SQLDataType.VARCHAR(36), this, "「createdBy」- 创建人"); /** * The column <code>DB_ETERNAL.F_BOOK.UPDATED_AT</code>. 「updatedAt」- 更新时间 */ public final TableField<FBookRecord, LocalDateTime> UPDATED_AT = createField("UPDATED_AT", org.jooq.impl.SQLDataType.LOCALDATETIME, this, "「updatedAt」- 更新时间"); /** * The column <code>DB_ETERNAL.F_BOOK.UPDATED_BY</code>. 「updatedBy」- 更新人 */ public final TableField<FBookRecord, String> UPDATED_BY = createField("UPDATED_BY", org.jooq.impl.SQLDataType.VARCHAR(36), this, "「updatedBy」- 更新人"); /** * Create a <code>DB_ETERNAL.F_BOOK</code> table reference */ public FBook() { this(DSL.name("F_BOOK"), null); } /** * Create an aliased <code>DB_ETERNAL.F_BOOK</code> table reference */ public FBook(String alias) { this(DSL.name(alias), F_BOOK); } /** * Create an aliased <code>DB_ETERNAL.F_BOOK</code> table reference */ public FBook(Name alias) { this(alias, F_BOOK); } private FBook(Name alias, Table<FBookRecord> aliased) { this(alias, aliased, null); } private FBook(Name alias, Table<FBookRecord> aliased, Field<?>[] parameters) { super(alias, null, aliased, parameters, ""); } /** * The class holding records for this type */ @Override public Class<FBookRecord> getRecordType() { return FBookRecord.class; } /** * {@inheritDoc} */ @Override public Schema getSchema() { return Db.DB_ETERNAL; } /** * {@inheritDoc} */ @Override public List<Index> getIndexes() { return Arrays.<Index>asList(Indexes.F_BOOK_CODE, Indexes.F_BOOK_PRIMARY, Indexes.F_BOOK_SERIAL); } /** * {@inheritDoc} */ @Override public UniqueKey<FBookRecord> getPrimaryKey() { return Keys.KEY_F_BOOK_PRIMARY; } /** * {@inheritDoc} */ @Override public List<UniqueKey<FBookRecord>> getKeys() { return Arrays.<UniqueKey<FBookRecord>>asList(Keys.KEY_F_BOOK_PRIMARY, Keys.KEY_F_BOOK_CODE, Keys.KEY_F_BOOK_SERIAL); } /** * {@inheritDoc} */ @Override public FBook as(String alias) { return new FBook(DSL.name(alias), this); } /** * {@inheritDoc} */ @Override public FBook as(Name alias) { return new FBook(alias, this); } /** * Rename this table */ @Override public FBook rename(String name) { return new FBook(DSL.name(name), null); } /** * Rename this table */ @Override public FBook rename(Name name) { return new FBook(name, null); } }
#!/usr/bin/env python # audio-video-resync # # Copyright (c) 2014 British Broadcasting Corporation # Copyright (c) 2019 <NAME> # Copyright (c) 2021 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from setuptools import setup # python setup.py build sdist clean install & audio-video-resync # twine upload -u USERNAME -p PASSWORD "dist/audio-video-resync-1.0.0.tar.gz" setup( name='audio-video-resync', version='1.0.0', description='通过波形比较,得到两个音频的时间戳偏移值,合成新视频。 ', author='<NAME> and <NAME> and <NAME>', author_email='<EMAIL> and <EMAIL> and <EMAIL>', url='https://github.com/HaujetZhao/audio-video-resync', license='Apache License 2.0', packages=['audio_video_resync'], install_requires=[ 'scipy>=0.12.0', 'numpy', 'matplotlib', 'librosa', 'icecream' ], entry_points={ # Option: console_scripts gui_scripts 'console_scripts': [ 'audio-video-resync=audio_video_resync.__main__:main', 'audio_video_resync=audio_video_resync.__main__:main' 'AudioVideoResync=audio_video_resync.__main__:main', ] }, )
package org.loed.framework.common.consistenthash.impl; import org.loed.framework.common.consistenthash.HashFunction; /** * @author Thomason * @version 1.0 * @since 13-5-30 下午5:13 */ public class APHash implements HashFunction { @Override public int hash(String str) { long hash = 0xAAAAAAAA; for (int i = 0; i < str.length(); i++) { if ((i & 1) == 0) { hash ^= ((hash << 7) ^ str.charAt(i) * (hash >> 3)); } else { hash ^= (~((hash << 11) + str.charAt(i) ^ (hash >> 5))); } } return (int) (hash % base); } @Override public int hash(Object key) { return hash(key.toString()); } }
Predicting the presence of bacterial pathogens in the airways of primary care patients with acute cough BACKGROUND: Bacterial testing of all patients who present with acute cough is not feasible in primary care. Furthermore, the extent to which easily obtainable clinical information predicts bacterial infection is unknown. We evaluated the diagnostic value of clinical examination and testing for C-reactive protein and procalcitonin for bacterial lower respiratory tract infection. METHODS: Through a European diagnostic study, we recruited 3104 adults with acute cough (≤ 28 days) in primary care settings. All of the patients underwent clinical examination, measurement of C-reactive protein and procalcitonin in blood, and chest radiography. Bacterial infection was determined by conventional culture, polymerase chain reaction and serology, and positive results were defined by the presence of Streptococcus pneumoniae, Haemophilus influenzae, Mycoplasma pneumoniae, Bordetella pertussis or Legionella pneumophila. Using multivariable regression analysis, we examined the association of diagnostic variables with the presence of bacterial infection. RESULTS: Overall, 539 patients (17%) had bacterial lower respiratory tract infection, and 38 (1%) had bacterial pneumonia. The only item with diagnostic value for lower respiratory tract infection was discoloured sputum (area under the receiver operating characteristic curve 0.56, 95% confidence interval 0.540.59). Adding C-reactive protein above 30 mg/L increased the area under the ROC curve to 0.62 (95% CI 0.590.65). For bacterial pneumonia, comorbidity, fever and crackles on auscultation had diagnostic value (area under ROC curve 0.68, 95% CI 0.580.77). Adding C-reactive protein above 30 mg/L increased the area under the ROC curve to 0.79 (95% CI 0.710.87). Procalcitonin did not add diagnostic information for any bacterial lower respiratory tract infection, including bacterial pneumonia. INTERPRETATION: In adults presenting with acute lower respiratory tract infection, signs, symptoms and C-reactive protein showed diagnostic value for a bacterial cause. However, the ability of these diagnostic indicators to exclude a bacterial cause was limited. Procalcitonin added no clinically relevant information. L ower respiratory tract infections such as acute bronchitis and pneumonia are common in primary care, with an annual incidence of 44 per 1000 in adults. 1,2 A potential bacterial pathogen is isolated from 19% to 43% of patients who present to general practitioners with lower respiratory tract infection. Bacterial infections are generally assumed to require more active treatment, including anti biotics and follow-up, because complications are more common, whereas guidelines recommend that unnecessary use of antibiotics be reduced. Therefore, it seems useful to accurately identify patients with a bac terial cause of lower respiratory tract infection, including bacterial pneu monia, to allow appropriate treatment to be started and follow-up arranged. Conversely, excluding a bacterial cause with confidence will help to avoid unnecessary antibiotic therapy and reduce antimicrobial resistance. In primary care settings, patients with a high likelihood of bacterial lower respiratory tract infection are typically identified on the basis of easily obtainable clinical information, because microbiologic sampling and laboratory culture are time-consuming and costly, and the results are usually not available by the time a decision is needed about empiric antibiotic treatment. Moreover, routine use of chest radiography in all patients with lower respiratory tract infection to detect pneumonia in only a small proportion (5% 7 ) of patients does not balance the practical issues of exposure to radiation, time and costs. However, features that reliably predict a high probability of bacterial infection in primary care patients with lower respiratory tract infection have not been well described. There is some evidence for the diagnostic value of signs and symptoms from studies of hospital inpatients, but these patients ABSTRACT BACKGROUND: Bacterial testing of all patients who present with acute cough is not feasible in primary care. Furthermore, the extent to which easily obtainable clinical information predicts bacterial infection is unknown. We evaluated the diagnostic value of clinical examination and testing for C-reactive protein and procalcitonin for bacterial lower respiratory tract infection. METHODS: Through a European diagnostic study, we recruited 3104 adults with acute cough (≤ 28 days) in primary care settings. All of the patients underwent clinical examination, measurement of C-reactive protein and procalcitonin in blood, and chest radiog raphy. generally have more severe illness and more often have pneumonia relative to outpatients. The few observational studies of adults conducted in primary care showed that fever, headache, painful cervical lymph nodes, diarrhea and rhinitis predicted bacterial lower respiratory tract infection, but sample sizes in these studies were small. 4,5 Additional testing with the inflammation markers C-reactive protein and procalcitonin is potentially useful in predicting bacterial infection. 12 High levels of C-reactive protein, in addition to signs and symptoms, showed diagnostic value for pneumonia, 7 and higher procalcitonin level was associated with bac terial lower respiratory tract infection among hospital inpatients. 13 However, evidence for the added diagnostic value of these 2 markers for bacterial lower respiratory tract infection is limited. Here, we evaluated the diagnostic value of clinical examination and the added value of C-reactive protein and procalcitonin for predicting which patients with lower respiratory tract infection who presented with acute cough in primary care settings had a bacterial pathogen. Design and study population This cross-sectional observational study was part of the GRACE-09 study (Genomics to Combat Resistance against Antibiotics in Community-Acquired Lower Respiratory Tract Infection in Europe; www.grace-lrti.org/portal/en-gb/homepage). General practitioners in 16 primary care research networks in 12 European countries collected data for patients who presented with acute cough between October 2007 and April 2010. Each of the research networks had access to a minimum of 20 000 patients. Given the frequency of lower respiratory tract infections, many more eligible patients presented during the recruitment period than were invited to participate in this study; therefore, we probably did not achieve the goal of recruiting all consecutive eli gible patients. Nevertheless, we assume that this situation did not result in important clinical selection bias, because clinicians reported during and after the study that the main reason for not including all eligible patients was time constraints. 7 Eligible patients were at least 18 years old and presenting for the first time with a main symptom of acute or deteriorating cough (duration ≤ 28 d) or any clinical presentation con sidered by the general practitioner to be caused by lower respiratory tract infection. Further inclusion criteria were ability to fill out study documents and provide written informed consent. Exclusion criteria were pregnancy, lactation, treatment with antibiotics in the previous month and immunodeficiency. 14 Clinical measurements The general practitioner recorded medical history details, results of the physical examination and comorbidities for each patient, using a standard case report form. Within 24 hours of presentation, a venous blood sample was obtained for measurement of C-reactive protein and procalcitonin; these samples were transported to and analyzed at the laboratory of the University of Antwerp. C-reactive protein was measured with the conventional immunoturbidimetric method (Vitros 5.1FS chemistry system, Ortho Diagnostics, for serum samples analyzed from 2007 to September 2009; Dimension Vista System, Siemens, for serum samples analyzed from October 2009 onward). Procalcitonin was measured using a rapid sensitive assay (Kryptor procalcitonin analyzer, Brahms GmbH). A sputum sample, if the cough was productive (not available for all participants), and naso pharyngeal swab sample were collected from each patient on the day of presentation, before any antibiotic therapy was started. Sputum samples were sent to each general practitioner's local laboratory and processed immediately. Direct microscopy, gram staining and culture were performed according to a standardized protocol (as outlined in Appendix 1, available at www.cmaj.ca/lookup/suppl/doi:10.1503/cmaj.151364/-/DC1). Nasopharyngeal swabs, stored in Universal Transport Medium (Copan Diagnostics) and in skim milk medium, were sent to the laboratory of the University of Antwerp for bacterial and viral polymerase chain reaction analysis. All patients underwent chest radiography within 7 days of presentation, preferably within 3 days. Local radiologists assessed the radiographs without access to patients' clinical information, but they did have access to previous radiographs, if available. The radiologists diagnosed pneu monia on the basis of a uniform procedure (see Appendix 2, available at www.cmaj.ca/lookup/suppl/ doi:10.1503/cmaj.151364/-/DC1). 7 Definition of bacterial infection We defined bacterial infection as the presence of Streptococcus pneumoniae, Haemophilus influenzae, Mycoplasma pneumoniae, Bordetella pertussis or Legionella pneumophila in respiratory samples or serologic evidence of Mycoplasma pneumoniae infection. We did not include Chlamydia pneumoniae, because the clinical relevance of this infection is unclear. 3,15 Infection with S. pneumoniae or H. influ enzae was defined by isolation of a predominant microorganism in the sputum (ratio of leuk ocytes to epithelial cells ≥ 1 as criterion for good-quality sample) or from the nasopharyngeal swab. Infection with B. pertussis was determined by polymerase chain reaction (from nasopharyngeal swab and sputum samples) and by measurement of immunoglobulin G (IgG) antibodies to pertussis toxin in venous blood at day 28. In addition, recent infection with B. pertussis was based on an antibody titre to pertussis toxin of 125 IU/mL or greater or a positive result on polymerase chain reaction in a respiratory sample. Infection with M. pneumoniae or L. pneumophila was determined by a positive result on polymerase chain reaction of nasopharyngeal swabs. Serologically definitive M. pneumoniae infection was defined as the presence of immunoglobulin M antibodies in the sample from day 1 or day 28 (or both) or by IgG seroconversion or a significant increase in IgG between days 1 and 28. Diagnostic outcomes The diagnostic value of clinical examination, C-reactive protein and procalcitonin were determined for bacterial lower respiratory tract infection and separately for bacterial pneumonia. Bac-terial infection was deemed to be present in patients in whom any of the above-mentioned bacteria were identified. Bacterial pneumonia was defined by a diagnosis of pneumonia on chest radiography combined with the presence of any of the abovementioned bacteria. Data analysis All analyses were performed for the diagnostic outcomes of bacterial lower respiratory tract infection and bacterial pneumonia. According to the literature and clinical reasoning, we selected the most promising symptoms and signs, 16 which we then related to the outcome by multivariable logistic regression analysis. We dichotomized age at 75 years. Using backward selection, we deleted nonsignificant items in a stepwise manner from the combination of signs and symptoms, where nonsignificance was defined as p value greater than 0.10 for the log-likelihood ratio test. 17 For the resulting reduced model based on signs and symptoms, we computed the area under the receiver operating characteristic (ROC) curve. By consensus, we considered an area under the ROC curve of 0.8 or greater as clinically relevant. We compared both C-reactive protein 7,18-21 and procalcitonin 13 with the outcome as con tinuous variables. We also compared C-reactive protein with the outcome at thresholds of greater than 20, greater than 30 and greater than 100 mg/L. 7,18-21 Note: CI = confidence interval, CRP = C-reactive protein, OR = odds ratio, SD = standard deviation. *Except where indicated otherwise. The OR compares patients with and without bacterial LRTI. The OR compares patients with and without bacterial pneumonia. §The following comorbidities were considered: pulmonary comorbidities (history of chronic obstructive pulmonary disease, asthma or other lung disease), cardiac comorbidities (history of heart failure, ischemic heart disease or other heart disease) and diabetes mellitus. The difference in area under the ROC curve was used to evaluate increase in discrimination after adding C-reactive protein or procalcitonin to the reduced combination of symptoms and signs (with fixed regression coefficients for signs and symptoms). 4-6,13 C-reactive protein was added dichotomously at above 30 mg/L, because this level was previously shown to add most diagnostic value for pneumonia in cases of lower respiratory tract infection in primary care. 7 Procalcitonin was added con tinuously, because no relevant thresholds have previously been shown in primary care. With the method of DeLong and associates, 22 we calculated the 95% confidence interval (CI) of the ROC difference. For each model, the calibration was quantified using the Hosmer-Lemeshow test. We calculated the pos itive and negative predictive values for all items in the reduced signs and symptoms model that had positive or negative results, respectively, with C-reactive protein or procalcitonin added. Finally, because we anticipated that there might have been misclassification of bacterial lower respiratory tract infection for patients with chronic obstructive pulmonary disease and for smokers (subgroups with higher levels of col onization), we performed 2 sensitivity analyses on the association between diagnostic variables and the presence of bacterial infection. One of the sensitivity analyses was restricted to patients without chronic obstructive pulmonary disease, and the other was restricted to those who did not smoke. Data were analyzed using SPSS for Windows software (version 20). Ethics approval The study was approved by the medical ethics committee of the University Medical Center Utrecht. Patient characteristics and diagnoses A total of 3104 patients were included in the GRACE study. The mean age of the 3104 participants was 50 (standard deviation 17) years, 40% were men (n = 1244) and 28% (n = 871) were current smokers (Table 1) Diagnostic value of symptoms and signs The only independent predictor for bacterial lower respiratory tract infection was dis coloured sputum ( Table 2). This variable resulted in area under the ROC curve of 0.56 (95% CI 0.54-0.59). The 2 sensitivity analyses (one restricted to the 2919 patients without chronic obstructive pulmonary disease and the other restricted to the 2233 patients who did not smoke) did not lead to any change in the findings. Added diagnostic value of C-reactive protein and procalcitonin The mean C-reactive protein was 34 (SD 53) mg/L in patients with bacterial lower respiratory tract infection and 97 (SD 98) mg/L for those with bacterial pneumonia (Table 1) Interpretation In this study of patients with lower respiratory tract infection, the combined diagnostic value of signs and symptoms was limited. The negative predictive value for signs and symptoms and C-reactive protein level combined was 87.5%, but the clinical utility was low, given the prior chance of absence of a bacterial pathogen (83%). Although C-reactive protein added diagnostic value, procalcitonin did not. Our findings confirm those of previous studies, in which clinical examination provided little diagnostic value for bacterial causes of lower respiratory tract infection in adults. 3,5 However, Graffelman and associates 4 found that headache, fever, painful cervical lymph nodes, diarrhea and rhinitis provided diagnostic value for bacterial lower respiratory tract infection in primary care (area under the ROC curve 0.79). However, their study sample was small (n = 145). 4 Previous studies showed the relation between elevated C-reactive protein and a bacterial cause of lower respiratory tract infection. 3,4,6 However, they did not analyze the added value of C-reactive protein beyond the results of clinical examination. 3,6 Graffelman and associates 4 reported no added diagnostic value of C-reactive protein when used with clinical examination for bacterial lower respiratory tract infection. 4 Holm and colleagues 6 reported an association between procalcitonin and bac terial infection in primary care, but they did not include the results of clinical examination. Limitations One potential limitation of this study was misclassification of bacterial lower respiratory tract infection on the basis of airway bacterial col onization. We believe that such misclassification was limited, because colonization of the lower airways is unlikely in symptomatic ambulatory outpatients. Moreover, excluding patients with chronic obstructive pulmonary disease and smokers (subgroups with higher levels of col onization 23 ) did not yield different findings. Finally, defining pneumonia on the basis of radiography rather than clinical features may limit generalizability to patients with pneumonia diagnosed on the basis of clinical assessment. Conclusion Signs, symptoms and C-reactive protein had limited clinical utility in predicting a bacterial cause for outpatients with lower respiratory tract infection. Procalcitonin added no information in the primary care setting. To support antibiotic stewardship, better markers of bacterial causes of infection should be developed.
<filename>pkg/ca/fileca/fileca.go // Copyright 2021 The Sigstore Authors. // // 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 fileca import ( "context" "crypto" "crypto/rand" "crypto/x509" "sync" "github.com/fsnotify/fsnotify" "github.com/sigstore/fulcio/pkg/ca" "github.com/sigstore/fulcio/pkg/ca/x509ca" "github.com/sigstore/fulcio/pkg/challenges" "github.com/sigstore/sigstore/pkg/cryptoutils" ) type fileCA struct { sync.RWMutex certs []*x509.Certificate key crypto.Signer } // NewFileCA returns a file backed certificate authority. Expects paths to a // certificate and key that are PEM encoded. The key must be encrypted // according to RFC 1423 func NewFileCA(certPath, keyPath, keyPass string, watch bool) (ca.CertificateAuthority, error) { var fca fileCA var err error fca.certs, fca.key, err = loadKeyPair(certPath, keyPath, keyPass) if err != nil { return nil, err } if watch { watcher, err := fsnotify.NewWatcher() if err != nil { return nil, err } err = watcher.Add(certPath) if err != nil { return nil, err } err = watcher.Add(keyPath) if err != nil { return nil, err } go ioWatch(certPath, keyPath, keyPass, watcher, fca.updateX509KeyPair) } return &fca, err } func (fca *fileCA) updateX509KeyPair(certs []*x509.Certificate, key crypto.Signer) { fca.Lock() defer fca.Unlock() // NB: We use the RWLock to unsure a reading thread can't get a mismatching // cert / key pair by reading the attributes halfway through the update // below. fca.certs = certs fca.key = key } func (fca *fileCA) getX509KeyPair() (*x509.Certificate, crypto.Signer) { fca.RLock() defer fca.RUnlock() return fca.certs[0], fca.key } // CreateCertificate issues code signing certificates func (fca *fileCA) CreateCertificate(_ context.Context, subject *challenges.ChallengeResult) (*ca.CodeSigningCertificate, error) { cert, err := x509ca.MakeX509(subject) if err != nil { return nil, err } rootCA, privateKey := fca.getX509KeyPair() finalCertBytes, err := x509.CreateCertificate(rand.Reader, cert, rootCA, subject.PublicKey, privateKey) if err != nil { return nil, err } return ca.CreateCSCFromDER(subject, finalCertBytes, fca.certs) } func (fca *fileCA) Root(ctx context.Context) ([]byte, error) { fca.RLock() defer fca.RUnlock() return cryptoutils.MarshalCertificatesToPEM(fca.certs) }
NASA released several spooky sounds from across the solar system ahead of Halloween. The agency put together a compilation of elusive sounds of howling planets and whistling helium. The sounds released Thursday, include: Juno Captures the 'Roar' of Jupiter: NASA's Juno spacecraft has crossed the boundary of Jupiter's immense magnetic field. Juno's Waves instrument recorded the encounter with the bow shock over the course of about two hours on June 24, 2016. Plasma Waves: Plasma waves, like the roaring ocean surf, create a rhythmic cacophony that — with the EMFISIS instrument aboard NASA’s Van Allen Probes — we can hear across space. Saturn's Radio Emissions: Saturn is a source of intense radio emissions, which were monitored by the Cassini spacecraft. The radio waves are closely related to the auroras near the poles of the planet. These auroras are similar to Earth's northern and southern lights. More of Saturn's eerie-sounding radio emissions. Sounds of Jupiter: Scientists sometimes translate radio signals into sound to better understand the signals. This approach is called "data sonification". On June 27, 1996, the Galileo spacecraft made the first flyby of Jupiter's largest moon, Ganymede, and this audio track represents data from Galileo's Plasma Wave Experiment instrument. Sounds of a Comet Encounter: During its Feb. 14, 2011, flyby of comet Tempel 1, an instrument on the protective shield on NASA's Stardust spacecraft was pelted by dust particles and small rocks, as can be heard in this audio track. Go to NASA’s website for more information. ►Make it easy to keep up-to-date with more stories like this. Download the 10 News app now. Have a news tip? Email desk@wtsp.com, or visit our Facebook page or Twitter feed.
Evaluation Games for Shapiro s Logic of Vagueness in Context Stewart Shapiro presents a model for reasoning with vague propositions with a special focus on Sorites situations. He maintains that the extensions and anti-extensions of vague predicates such as bald and red strongly depend on the conversational context. At the beginning of a conversation this context is empty; the extensions and anti-extensions of vague predicates are undefined for many objects, the so-called borderline cases. During a conversation these notions are sharpened, such that borderline cases, which have been undecided so far, get assigned to the (anti-)extension of the vague predicates in question.(It is the counterpart to the notion of supertruth in supervaluationist theories) Shapiro introduces logical connectives operating on formulas containing such vague predicates. Additionally to the classical connectives, he introduces new ones operating globally on trees of possible contexts. This contribution introduces a Hintikka-style game for evaluating formulas according to Shapiros model of vagueness. This is motivated by the following two observations:
/// Constructs a new iterator reader. pub fn new(iter: I) -> IterReader<I, R> { IterReader { iter: iter, curr: None, } }
package org.omnetpp.common.importexportwizards; import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.Wizard; import org.eclipse.ui.IImportWizard; import org.eclipse.ui.IWorkbench; import org.omnetpp.common.CommonPlugin; import org.omnetpp.common.IConstants; import org.omnetpp.common.wizard.IContentTemplate; import org.omnetpp.common.wizard.ITemplateBasedWizard; import org.omnetpp.common.wizard.TemplateSelectionPage; /** * Import OMNeT++ File wizard. Brings up the IContentTemplates that support the * wizard type "import", lets the user pick one, then delegates to a wizard * that can run the given template. * * @author Andras */ public class ImportWizard extends Wizard implements IImportWizard { private static final String NEWWIZARDS_EXTENSION_POINT_ID = "org.eclipse.ui.newWizards"; private TemplateSelectionPage templateSelectionPage; private IWorkbench workbench; private IStructuredSelection selection; private static Map<String,String> wizardTypeToId = new HashMap<String, String>(); static { wizardTypeToId.put("nedfile", IConstants.NEW_NEDFILE_WIZARD_ID); wizardTypeToId.put("msgfile", IConstants.NEW_MSGFILE_WIZARD_ID); wizardTypeToId.put("inifile", IConstants.NEW_INIFILE_WIZARD_ID); wizardTypeToId.put("network", IConstants.NEW_NETWORK_WIZARD_ID); wizardTypeToId.put("compoundmodule", IConstants.NEW_COMPOUND_MODULE_WIZARD_ID); wizardTypeToId.put("simplemodule", IConstants.NEW_SIMPLE_MODULE_WIZARD_ID); wizardTypeToId.put("simulation", IConstants.NEW_SIMULATION_WIZARD_ID); wizardTypeToId.put("project", IConstants.NEW_OMNETPP_CC_PROJECT_WIZARD_ID); } public ImportWizard() { // code copied from PreferencesExportWizard IDialogSettings workbenchSettings = CommonPlugin.getDefault().getDialogSettings(); IDialogSettings section = workbenchSettings.getSection("ImportWizard"); if (section == null) section = workbenchSettings.addNewSection("ImportWizard"); setDialogSettings(section); } public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; this.selection = selection; } @Override public void addPages() { addPage(templateSelectionPage = new TemplateSelectionPage("import", true)); templateSelectionPage.setTitle("Select Importer"); } @Override public IWizardPage getNextPage(IWizardPage page) { if (page == templateSelectionPage) { IContentTemplate template = templateSelectionPage.getSelectedTemplate(); if (template != null) { String wizardType = chooseWizardTypeFor(template); try { ITemplateBasedWizard wizard = createWizard(wizardType); wizard.setContainer(getContainer()); wizard.setTemplate(template); wizard.setImporting(true); wizard.init(workbench, selection); wizard.addPages(); return wizard.getStartingPage(); } catch (CoreException e) { CommonPlugin.logError("Cannot create wizard for template " + template.getName(), e); } } return null; } return super.getNextPage(page); } protected String chooseWizardTypeFor(IContentTemplate template) { // by default we'd like to invoke the "New Network" wizard; if not supported, // here's a decreasing preference order of wizards String[] preferredOrder = "network nedfile compoundmodule simplemodule msgfile inifile simulation project".split(" "); for (String type : preferredOrder) if (template.getSupportedWizardTypes().contains(type)) return type; // ok, return what it supports for (String type : template.getSupportedWizardTypes()) if (!type.equals("import")) return type; // looks like it does not support anything return null; } protected ITemplateBasedWizard createWizard(String wizardType) throws CoreException { String id = wizardTypeToId.get(wizardType); if (id == null) throw new IllegalArgumentException("Cannot find wizard for wizardType='" + wizardType + "'"); IConfigurationElement wizardConfigElement = null; IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(NEWWIZARDS_EXTENSION_POINT_ID); for (IConfigurationElement e : config) if (id.equals(e.getAttribute("id"))) wizardConfigElement = e; if (wizardConfigElement == null) throw new IllegalArgumentException("Cannot find wizard for wizardType='" + wizardType + "'"); return (ITemplateBasedWizard) wizardConfigElement.createExecutableExtension("class"); } @Override public boolean performFinish() { return false; } }
<gh_stars>1-10 export interface MapLike { new (...args: any[]): any } export declare type CacheConstructor = | MapConstructor | WeakMapConstructor | MapLike | Record<any, any> declare const memoize: <T extends any[], U extends unknown>( mapConstructors: CacheConstructor[], fn: (...args: T) => U ) => (...args: T) => U export default memoize
from handlers.wechatGZH.wxlogger import logger """这是一个处理客户发送信息的文件""" def reply_text(FromUserName, ToUserName, CreateTime, Content): """回复文本消息模板""" textTpl = """<xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <Content><![CDATA[%s]]></Content></xml>""" out = textTpl % (FromUserName, ToUserName, CreateTime, 'text', Content) return out def receive_msg(msg): # 这是一个将疑问改成成熟句子的函数,例如:你好吗 公众号回复:你好 if msg[-1] == u'吗': return msg[:len(msg) - 1] elif len(msg) > 2 and msg[-2] == u'吗': return msg[:len(msg) - 2] else: return "你说的话我好像不明白?" def receive_event(event, key): # 如果是关注公众号事件 if event == 'subscribe': return "感谢关注!" # 如果是点击菜单拉取消息事件 elif event == 'CLICK': # 接下来就是根据你点击不同的菜单拉去不同的消息啦 # 我为了省事,不进行判断啦,如果需要判断请根据 key进行判断 return "你点击了菜单" + key # 如果是点击菜单跳转Url事件,不做任何处理因为微信客户端会自行处理 elif event == 'VIEW': return None
#include<bits/stdc++.h> #define ll long long int using namespace std; int main() { ll n,m; cin>>n>>m; if(n==1 && m==1) cout<<"0"<<"\n"; else if(n!=1 && m==1) { ll x=(n*(n-1))/2; cout<<x<<"\n"; } else if(n==1 && m!=1) { ll y=(m*(m-1))/2; cout<<y<<"\n"; } else { ll p=(n*(n-1))/2; ll q=(m*(m-1))/2; cout<<p+q<<"\n"; } }
BIOTA ACCUMULATION OF POLYCYCLIC AROMATIC HYDROCARBONS IN BENIN COASTAL WATERS The contamination levels of 12 US-EPA polycyclic aromatic hydrocarbons (PAHs) from the tri-aromatics to the hexa- aromatics in biota and sediment of Cotonou's lagoon and Benin's continental shelf waters are identified in this paper. PAHs were analyzed by gas-chromatography coupled with mass spectrometry (GC-SM). Total lipid contents (TLC) were measured for biota, and total organic carbon content (TOC) for sediment. Total PAH concentrations obtained for organisms ranged between 15 and 102ngg− 1, with mussels accumulating the highest concentrations of PAHs. The lowermolecular-weight (LMW) 3 ring PAHs were predominant in all biota and showed similar distribution patterns. Phenanthrene accounts for 76% of total bioaccumulation factors (BAFs). Biota and sediment accumulation factors (BSAFs) showed that the mussels are exposed to the LMW PAHs more than to the hydrophobic higher-molecular-weight (HMW) PAHs in the Benin coastal waters.
Serum adiponectin in HIV-1 and hepatitis C virus mono- and co-infected Kenyan injection drug users Adiponectin is an important marker of anthropometric profiles of adipose tissue. However, association of adiponectin and adiposity in HIV mono- and co-infected and hepatitis (HCV) injection drug users (IDUs) has not been elucidated. Therefore, the relationship of total adiponectin levels with anthropometric indices of adiposity was examined in HIV mono-infected (anti-retroviral treatment, ART-naive, n=16 and -experienced, n=34); HCV mono-infected, n=36; HIV and HCV co-infected (ART-naive, n=5 and -experienced, n=13); uninfected, n=19 IDUs; and healthy controls, n=16 from coastal Kenya. Anthropometric indices of adiposity were recorded and total circulating adiponectin levels were measured in serum samples using enzyme-linked immunosorbent assay. Adiponectin levels differed significantly amongst the study groups (P<0.0001). Post-hoc analyses revealed decreased levels in HIV mono-infected ART-naive IDUs in comparison to uninfected IDUs (P<0.05) and healthy controls (P<0.05). However, adiponectin levels were elevated in HCV mono-infected IDUs relative to HIV mono-infected ART-naive (P<0.001) and -experienced (P<0.001) as well as HIV and HCV co-infected ART-naive (P<0.05) IDUs. Furthermore, adiponectin correlated with weight (=0.687; P=0.003) and BMI (=0.598; P=0.014) in HIV mono-infected ART-naive IDUs; waist circumference (=−0.626; P<0.0001), hip (=−0.561; P=0.001) circumference, and bust-to-waist ratio (=0.561; P=0.001) in HIV mono-infected ART-experienced IDUs; waist girth (=0.375; P=0.024) in HCV mono-infected IDUs; and waist-to-hip ratio (=−0.872; P=0.048) in HIV and HCV co-infected ART-naive IDUs. Altogether, these results suggest suppression of adiponectin production in treatment-naive HIV mono-infected IDUs and that circulating adiponectin is a useful surrogate marker of altered adiposity in treatment-naive and -experienced HIV and HCV mono- and co-infected IDUs. Introduction Injection drug use and associated co-morbidities are an increasing public health burden in the world. An estimated 15.9 million people worldwide are injection drug users (IDUs), comprising 3 and 10 million HIV and hepatitis C virus (HCV) infections respectively. Due to overlaps in risks and modes of acquiring infection, 75% of the global injection drug using population is co-infected with HIV and HCV viruses. The interaction of HIV and HCV infections and injection drug use is largely undefined. However, injection drugs such as heroin promotes disease progression in HIV and HCV infected individuals. Despite anti-retroviral treatment improving quality of life, adverse metabolic syndromes frequently develop in HIV infected individuals. For instance, accumulation of visceral and dorso-cervical adipose tissue, breast enlargement, and loss of facial and limb subcutaneous fat are attributable to anti-retroviral drugs, especially nucleoside reverse transcriptase inhibitors (NRTI) and protease inhibitors (PI). In addition, HIV and HCV monoand co-infected individuals are at an increased risk of developing lipodystrophy, suggesting propensity for adipose redistribution and dysfunction. Although anthropometric indices correlate with total body, central body, subcutaneous and visceral adiposities, surrogate markers of adiposity in IDUs are largely undefined. However, previous studies showing higher rates of malnutrition (BMI !18.5 kg/m 2 ), lower body weight and fat mass in HIV-infected and uninfected IDUs, indicate that anthropometric measures are valuable in estimating adiposity in IDUs. In addition, the link between lipodystrophy and adipocyte dysfunction suggests that dysregulation in circulating adipokine production correlates with adiposity. Adiponectin is an adipocytokine produced almost exclusively by adipose tissue with pleiotropic regulatory effects on carbohydrate, lipid and protein metabolism. Previous studies indicated reduced circulating adiponectin levels in heroin and crack cocaine addicts along with cigarette smokers. In contrast, chronic alcohol consumption is associated with increased serum adiponectin levels, suggesting that substance consumption promotes alterations in the production of circulating adiponectin. In addition, previous studies indicated decreased circulating adiponectin levels in lipodystrophic ART-naive and -experienced HIV patients. Likewise, decreased serum adiponectin levels are associated with higher BMI in HCV patients, indicating that adiponectin is an important correlate of adiposity in HIV and HCV infections. Although injection drug use alters adiponectin and anthropometric profiles of HIV infected and -uninfected IDUs, host markers underlying adipose tissue status in IDUs presenting with HIV and HCV mono-and co-infections are largely unknown. We have previously shown altered clinical chemistry profiles in HIV infected ART-naive and -experienced injection heroin users from coastal Kenya. In the present study, we determined serum total adiponectin levels and their association with anthropometric markers among HIV and HCV mono-and co-infected ART-naive and -experienced IDUs. Study site and population This hospital-based, cross-sectional study was conducted as part of a wider study investigating the nutritional and microbiological correlates of HIV infection among IDUs. Upon enrolment, the study participants were stratified as follows: i) HIV mono-infected ART-naive; ii) HIV monoinfected ART-experienced; iii) HCV mono-infected; iv) HIV and HCV co-infected ART-naive; v) HIV and HCV co-infected ART-experienced; and vi) HIV and HCV negative (uninfected) IDUs; and vii) healthy controls. Injection drug users were defined as individuals with a history of injection drug use, reporting injecting any illicit drugs at least once in the previous month, and showing evidence of injection needle-stick scars, while healthy controls were individuals reporting having never used any illicit drugs from the UNODC report. At the time of enrolment in the study, ART-naive study participants had not been initiated on ART while individuals on ART (ARTexperienced) were receiving first line anti-retroviral drugs. These comprised of tenofovir (TDF) or zidovudine (AZT)C lamivudine (3TC)Cnevirapine (NVP) or efavirenz (EFV). The protease inhibitors were mainly used in postexposure prophylaxis and second-line HIV treatment or and as part of the TDF or abacavir (ABC)C3TCClopinavirritonavir (LPVr) regimen. Individuals with underlying disease conditions, including diabetes mellitus, were excluded from the study. Approximately, 10 ml of venous blood samples were collected from the study participants and aliquoted into plain and EDTA BD vacutainer tubes (BD, Franklin Lakes, NJ, USA). EDTA blood samples were used for CD 4C T cell enumeration and plasma preparation for HIV and HCV sero-testing and HIV viral load quantification as previously described. All blood samples were collected in the morning before 01000 h and haematologic analyses were performed within 30 min of blood collection to minimize variability in the measurements. Serum samples were prepared from plain tube blood and frozen at K80 8C until used for batched measurements of adiponectin. Anthropometric assessment Anthropometric measures of the study participants were obtained according to WHO criteria. Height and weight were measured while participants stood upright, with no shoes, and wearing light clothing. Waist circumference was measured at the midpoint of the lower margin of the last palpable rib and the top of the iliac crest (hip bone). Hip circumference was obtained around the maximum circumference of the buttocks. Bust circumference was taken around the chest and below the armpits after exhalation while mid-upper-arm circumference (MUAC) was measured at the mid-point between the tip of the shoulder and the tip of the elbow. Height (m) and weight (kg) measurements were used to calculate BMI (weight/height, kg/m 2 ). Waist-to-hip ratio and bust-to-hip ratio were calculated by dividing waist circumference (cm) with hip circumference (cm) and bust circumference (cm) by hip circumference (cm) respectively. Total adiponectin enzyme-linked immunosorbent assay Total adiponectin concentrations were determined in serum using commercial ELISA reagents according to manufacturer's protocols (R&D Systems, Minneapolis, MN, USA) with modifications. Briefly, ELISA microtitre plate wells (MaxiSorp, Denmark) were coated with 100 ml of 2.0 mg/ml mouse anti-human adiponectin monoclonal antibody. The wells were aspirated and washed two times using 300 ml of wash buffer (PBSC0.05% Tween-20, pH 7.2) and blocked with 100 ml of blocking buffer (1% BSA, BSAC PBS, pH 7.2). The wells were washed four times with wash buffer and 50 ml of diluted standards, and samples were added to respective wells in duplicate, then incubated with shaking for 2 h at room temperature. About 100 ml of 2.0 mg/ml biotinylated detection mouse anti-human adiponectin antibody were added to each well and incubated for 2 h at room temperature. Streptavidin-horse radish peroxidise was added at 50 ml/well and incubated for 20 min at room temperature. After four washes with wash buffer, 100 ml of tetramethylbenzinidine substrate were added to the wells and the plates were incubated in the dark for 20 min at room temperature. Colour development was stopped by addition of 1 N H 2 SO 4 and optical densities of each well were read at 450 nm with a reference of 630 nm using the Dynatech MR5000 Microplate Reader (Dynex Technologies, Inc., Chantilly, VA, USA). Sample concentrations were calculated using the appropriate standard calibration curves of the corresponding recombinant human adiponectin protein included in each assay plate. Ethical considerations The study was approved by Kenyatta University Ethical Review Committee. All study participants provided written informed consent prior to enrolment. Confidentiality of the study participant's information was ensured throughout the study. All the study participants were provided with free health education on sexually transmitted infections including HIV, hepatitis B and C, tuberculosis, hygiene, and nutrition. Participants testing positive for HIV and hepatitis virus infections were referred to the comprehensive care centres at Bomu Hospital or the Coast General Referral Hospital for treatment, care, and support. Data analysis Statistical analysis was conducted using GraphPad Prism Software v5 (GraphPad, Inc., San Diego, CA, USA). Nutritional and laboratory measures were summarized as medians (interquartile range, IQR) while gender, malnutrition and substance use summarized as proportions were tabulated. Adiponectin levels across study groups were presented as box plots. Statistical comparisons in categorical data across study groups were performed using c 2 -test as appropriate. Comparisons in continuous data across study groups were performed using Kruskal-Wallis test followed by Dunn's correction for multiple comparisons. Spearman's rank correlation tests were used to examine the associations of adiponectin levels with nutritional measures. All tests were two-tailed with statistical significance set at an a-value of 5%. Results A total of 139 adults (males, nZ90 and females, nZ49) were recruited into the study. The study participants comprised of IDUs categorised into HIV mono-infected (ART-naive, nZ16 and -experienced, nZ34) HCV monoinfected (nZ36); HIV and HCV co-infected (ART-naive, nZ5 and -experienced, nZ13); uninfected (nZ19) individuals; and healthy controls (nZ16). Demographic and clinical characteristics of the study participants are summarised in Table 1. Age of the study participants differed significantly amongst the study groups (PZ0.001) and was higher in the HCV mono-infected group compared to healthy individuals (P!0.05). The frequencies of female gender in the study groups were 50.0, 61.8, 2.8, 20.0, 15.4, 42.1, and 50.0% respectively. Non-injection substance consumption was also reported among IDUs. Alcohol, cigarette, bhang and cocktail were the most frequent non-injection substances reported, ranging from 13.9% in the HCV mono-infected group to 100.0% in HIV and HCV co-infected ART-naive individuals. Other non-injection drugs recorded included khat, analgesics, flunitrazepam and brown sugar. Discussion In this study, we examined the relationship between circulating adiponectin levels and anthropometric markers of adiposity in HIV and HCV mono-and co-infected IDUs. Previous studies show that circulating adiponectin levels are decreased in HIV treatment-naive and HCV mono-infected and co-infected non-substance users. However, circulating adiponectin levels in Kenyan HIV and HCV mono-and co-infected IDUs has not been reported. We found marked reduction in serum adiponectin in HIV mono-infected anti-retroviral-naive IDUs relative to healthy controls and uninfected IDUs, suggesting suppression of adiponectin production. Our results are, in part, consistent with previous studies showing decreased adiponectin protein and mRNA expression in HIV infected anti-retroviral treatmentnaive patients. Although the underlying mechanisms suppressing adiponectin release were not examined in the current study, opioid illicit drugs activate HIV receptor expression on human adipocytes promoting infectivity, replication and disease progression. Therefore, HIV infection in IDUs suppresses adipose tissue function leading to reduced adiponectin release. An inverse link between serum adiponectin levels and BMI and weight has previously been reported in non-drug using HIV uninfected and infected subjects. In addition, baseline serum adiponectin concentrations correlated inversely with BMI in drug-addicts on methadone maintenance treatment. In the present study, adiponectin concentrations were directly correlated with body weight and BMI in HIV mono-infected antiretroviral treatment-naive individuals, suggesting that malnutrition, a frequent morbidity in HIV positive IDUs, is associated with hypoadiponectinemia. Furthermore, HIV infection and substance consumption dysregulate total body adiposity leading to decreased release of adiponectin. Thus, serum adiponectin levels are valuable correlates of total body adiposity in HIV infected anti-retroviral treatment-naive IDUs. The indirect relationship of adiponectin with waist and hip circumferences in HIV mono-infected patients on anti-retroviral treatment indicates visceral and subcutaneous adiposity while the positive correlation with bust-to-hip ratio denotes breast region adiposity. Consistent with previous studies in HIV infected non-substance using patients on anti-retroviral treatment, a normal balance of adiponectin with visceral and upper trunk subcutaneous adiposity may result from anti-retroviral treatment in HIV infected IDUs. Likewise, our results are, in part, consistent with previous studies showing inverse associations of adiponectin with visceral adipose tissue, isolated central fat accumulation and non-lipodystrophic state in HIV patients on combinational anti-retroviral treatment, as well as an indirect link between high molecular weight to total adiponectin ratio and waist circumference in HIV infected women on highly active anti-retroviral treatment. Our results also corroborate previous studies showing positive associations between baseline adiponectin and waist circumference in overweight and obese drug addicts. We suggest that both injection and non-injection substances alter visceral and subcutaneous adipose tissue redistribution in HIV infected IDUs on anti-retroviral treatment. For instance, a mixed phenotype of HIV-positive patients comprising illicit drug and alcohol use, and anti-retroviral treatmentexperienced individuals exhibit lower and upper trunk adipose depots, chronic cannabis smoking is associated with lower abdominal subcutaneous adiposity, cigarette smoking is associated with higher visceral adiposity, while cathinone, the active compound in khat, induces lipolysis in vivo and inhibit free fatty release in isolated adipocytes. Although NRTIs induce increased development of lipodystrophic syndromes in HIV patients, none of our patients exhibited features of lipodystrophy. Therefore, serum adiponectin is a useful surrogate indicator of altered visceral and subcutaneous adiposity in IDUs on anti-retroviral treatment. The inverse associations between adiponectin and waist-to-hip ratio in HIV and HCV co-infected antiretroviral treatment-naive IDUs suggests central adiposity, while the positive correlations of adiponectin with waist girth in HCV mono-infected IDUs reflects visceral adiposity. This result, is in part, similar to previous studies showing associations between waist-to-hip ratio and central fat in HIV patients comprising 40% HCV and IDUs. Also, these findings parallel previous studies showing indirect associations between adiponectin levels and waist-to-hip ratio in HIV patients in whom w67% were co-infected with HIV and HCV. In addition, the positive associations of waist perimeter and adiponectin, are partly, similar to previous studies showing increased fatty liver in individuals with higher waist girth previously observed among HCV infected non-alcoholic patients. Abnormal central fat accumulation is a manifestation of HIV-associated lypodystrophy in patients on antiretroviral treatment. However, central and visceral adiposity in HIV and HCV co-infected treatment-naive and HCV mono-infected IDUs indicates alterations in lipid metabolism. This premise is supported by previous studies in HIV and HCV co-infected patients showing increased risk of having dyslipidaemias in carriers of mitochondrial DNA haplotypes and adiponectin genotypes that are associated with low serum adiponectin levels. Altogether, adiponectin is a useful marker of central and visceral fat in IDUs presenting with HCV mono-infection or HIV and HCV co-infections. The main limitation of this study was the self-reported non-injection substance consumption. In addition, fewer female study participants with HCV and ethnicity could limit evaluation of serum adiponectin with outcomes based on previous studies showing variations in serum adiponectin levels with ethnicity and gender. However, these factors should not limit interpretation of our results as the major pathogenic outcomes of HIV and HCV are similar across gender and ethnicity. The effect of poly-substance consumption on adiponectin production and adiposity is difficult to assess, as different substances have different effects on the adipose tissue. A prospective design incorporating lipid and toxicological analyses, and other measures of adiposity and clinical staging of HIV and HCV will provide additional insights into the influence of the interaction between HIV and HCV co-infection, injection and noninjection drug use and ART on circulating adiponectin levels. This could not be elucidated in this study owing to the cross-sectional design. In this study, anthropometric measures were taken and correlated with adiponectin levels, even though the clinical utility of some of these measures, especially BMI may be reduced in individuals presenting with lipodystrophy that is common in ART-naive and -experienced HIV infected subjects. In summary, our study shows that circulating total adiponectin levels are suppressed in HIV mono-infected anti-retroviral treatment-naive IDUs. Importantly, adiponectin levels are associated with anthropometric measures of adiposity indicating its utility in assessing and monitoring the nutritional profiles of HIV and HCV mono-and co-infected IDUs. This study underscores the complex nature of the interactions of HCV, HIV, ART and injection drug use on adipose tissue and the possible development of metabolic perturbations. performed statistical analyses and co-drafted the manuscript. E Mibei and R Lihana critically revised the manuscript. All authors have read and approved the final manuscript.
// // TZNetworkTask+Indicator.h // GIChainLib // // Created by ZT on 2018/5/18. // Copyright © 2018年 ChuangShiZhiLian. All rights reserved. // #import "TZNetworkTask.h" /** 网络请求任务类的界面展示分类 */ @interface TZNetworkTask (Indicator) /** 是否显示指示器 */ @property (nonatomic) BOOL showIndicator; /** 是否显示错误提示 */ @property (nonatomic) BOOL showNotice; /** 设置是否显示指示器 */ - (TZNetworkTask *(^)(BOOL))indicator; /** 设置是否显示错误提示 */ - (TZNetworkTask *(^)(BOOL))notice; @end
/** * MIT License * * Copyright (c) 2021 Team-Confused * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package Todo_Manager; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.layout.*; import javafx.scene.paint.Color; import javafx.stage.Stage; import java.io.IOException; import java.time.Instant; import java.time.ZoneId; import java.util.Date; public class AddSubTaskScreen{ public static Scene getAddSubTaskScreen(Stage primaryStage) { //Labels Label SubTask = new Label("Sub-Task Name: "); Label Description = new Label(" Description: "); Label dueDate = new Label(" Date: "); Label priority = new Label("Priority"); Label error = new Label("You have an empty field."); error.setVisible(false); ObservableList<Priority> options = FXCollections.observableArrayList(Priority.Low, Priority.Medium,Priority.High,Priority.ASAP); //Fields for data ComboBox<Priority> priorityIn = new ComboBox<Priority>(options); DatePicker date = new DatePicker(); TextArea description = new TextArea(); TextField subTask = new TextField(); // Next Button Button next = new Button("Next"); next.setAlignment(Pos.CENTER_RIGHT); next.setOnAction(value ->{ Boolean pass = false; if(subTask.getText().isBlank()|| description.getText().isBlank()||date.getValue() == null){ error.setVisible(true); } else{ try{ Manager.addSubTask(subTask.getText(), description.getText(), Date.from(Instant.from(date.getValue().atStartOfDay(ZoneId.systemDefault()))),priorityIn.getSelectionModel().getSelectedItem()); }catch (IOException e){ e.printStackTrace(); } primaryStage.setScene(MainScreen.getMainScene(primaryStage)); } }); //Adding Button to Hbox HBox hBox = new HBox(); hBox.getChildren().add(next); hBox.setAlignment(Pos.CENTER_RIGHT); //Grid pane GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.add(SubTask, 0,0); grid.add(dueDate, 0,1); grid.add(Description, 0,3); grid.add(priority, 0,2); grid.add(subTask, 1,0); grid.add(date, 1,1); grid.add(priorityIn, 1,2); grid.add(description, 1,3); grid.add(error,1,8); grid.setHgap(10); grid.setVgap(10); BorderPane pane = new BorderPane(); pane.setCenter(grid); pane.setBottom(hBox); pane.setBackground(new Background(new BackgroundFill(Color.LIGHTBLUE, CornerRadii.EMPTY, Insets.EMPTY))); Scene scene = new Scene(pane, 600,350 ); return scene; } }
<filename>src/staticstic.cpp /* * Tencent is pleased to support the open source community by making wwsearch * available. * * Copyright (C) 2018-present Tencent. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * https://opensource.org/licenses/Apache-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 OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ #include "staticstic.h" #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <unistd.h> #include <cstring> #include <sstream> namespace wwsearch { namespace { const int kBufferLen{512}; } // Add one metric. // [stat_name] + [result] -> [count] // If end == NULL, end will be set to current time. void Staticstic::AddStat(const std::string& stat_name, int result, int64_t count, const struct ::timeval& begin, struct ::timeval* end) { struct ::timeval internal_end; if (NULL == end) { gettimeofday(&internal_end, NULL); } else { std::memcpy(&internal_end, end, sizeof(struct ::timeval)); } AddStat(stat_name, result, count, Time::CalculateConsumeTimeUs(begin, internal_end)); } // Wrapper void Staticstic::AddStat(const std::string& stat_name, int result, const struct ::timeval& begin, struct ::timeval* end) { AddStat(stat_name, result, 1, begin, end); } // Innser api void Staticstic::AddStat(const std::string& stat_name, int result, int64_t count, uint64_t consume_us) { StatNameEntityListPtr stat_name_entity_list; std::lock_guard<std::mutex> guard(mutex_); stat_name_entity_list = stat_name_entity_list_; auto iter = stat_name_entity_list->find(stat_name); if (iter == stat_name_entity_list->end()) { ResultEntity result_entity{{result, StatEntity(count, consume_us)}}; stat_name_entity_list->emplace(stat_name, std::move(result_entity)); return; } ResultEntity& result_entity = iter->second; auto iter2 = result_entity.find(result); if (iter2 == result_entity.end()) { result_entity.emplace(result, StatEntity(count, consume_us)); return; } iter2->second.Add(count, consume_us); } // print to file int Staticstic::Reopen() { struct stat s; std::memset(&s, 0, sizeof(struct stat)); std::string inuse_log_file_name = log_file_base_ + std::string({".log"}); if (fd_ == NULL) { fd_ = fopen(inuse_log_file_name.c_str(), "a+"); } if (fd_ == NULL || stat(inuse_log_file_name.c_str(), &s) < 0) { printf("fd couldn't open or stat failed, inuse_log_file_name %s\n", inuse_log_file_name.c_str()); fd_ = NULL; return -1; } return s.st_size; } // switch another file. int Staticstic::SwitchFile() { int i = 0; int log_size = Reopen(); if (log_size < 0) { printf("Reopen faield!\n"); return -2; } if (log_size < log_max_size_) { return 0; } std::string log_file_name = log_file_base_ + std::to_string(log_max_num_ - 1) + std::string(".log"); if (access(log_file_name.c_str(), F_OK) == 0) { if (remove(log_file_name.c_str()) < 0) { return -1; } } for (i = log_max_num_ - 2; i >= 0; i--) { if (i == 0) { log_file_name = log_file_base_ + std::string(".log"); } else { log_file_name = log_file_base_ + std::to_string(i) + std::string(".log"); } if (access(log_file_name.c_str(), F_OK) == 0) { std::string new_log_file_name = log_file_base_ + std::to_string(i + 1) + std::string(".log"); if (rename(log_file_name.c_str(), new_log_file_name.c_str()) < 0) { return -1; } } } if (fd_ != NULL) { fclose(fd_); fd_ = NULL; } log_size = Reopen(); if (log_size < 0) { printf("Reopen faield!\n"); return -2; } return 0; } // write format void Staticstic::Write(const char* format, ...) { va_list ap; va_start(ap, format); vfprintf(fd_, format, ap); va_end(ap); fflush(fd_); } // print header std::string Staticstic::GetDateString() { char time_str[kBufferLen]{0}; timeval tval; gettimeofday(&tval, NULL); struct tm curr; curr = *localtime(&tval.tv_sec); snprintf(time_str, kBufferLen, "\n===============Staticstic in %ds, %04d-%02d-%02d " "%02d:%02d:%02d.%03d=====================\n", stat_total_time_us_ / (1000 * 1000), curr.tm_year + 1900, curr.tm_mon + 1, curr.tm_mday, curr.tm_hour, curr.tm_min, curr.tm_sec, (int)tval.tv_usec); return std::string(time_str); } // print header std::string Staticstic::BuildHeader() { char header[kBufferLen]{0}; snprintf(header, kBufferLen, "%32s|%8s|%16s|%16s|%9s|%9s|%9s|%9s|%9s|%9s|\n", "StatName", "RESULT", "TOTAL", "SUMVAL", "AVG(ms)", "MAX(ms)", "MIN(ms)", ">%50ms", ">%80ms", ">%90%ms"); return std::string(header); } // print body std::string Staticstic::BuildBody( const StatNameEntityListPtr& stat_name_entity_list) { std::ostringstream o; for (auto& stat_name_entity : *stat_name_entity_list) { for (auto& result_entity : stat_name_entity.second) { auto& entity = result_entity.second; uint64_t consume_us_50 = 0; uint64_t consume_us_80 = 0; uint64_t consume_us_90 = 0; std::tie(consume_us_50, consume_us_80, consume_us_90) = entity.ConsumeUs(); char body[kBufferLen]{0}; snprintf(body, kBufferLen, "%32s|%8d|%16llu|%16llu|%9.3f|%9.3f|%9.3f|%9.3f|%9.3f|" "%9.3f|\n", stat_name_entity.first.c_str(), result_entity.first, entity.InvokeCount(), entity.Count(), entity.AvgConsumeUs() / 1000.0, entity.MaxConsumeUs() / 1000.0, entity.MinConsumeUs() / 1000.0, consume_us_50 / 1000.0, consume_us_80 / 1000.0, consume_us_90 / 1000.0); o << std::string(body); } } o << std::string( {"-----------------------------------------------------------------------" "-----------------\n\n"}); return o.str(); } // Print statistic info to file. void Staticstic::Report() { StatNameEntityListPtr stat_name_entity_list(new StatNameEntityList); { std::lock_guard<std::mutex> guard(mutex_); stat_name_entity_list_.swap(stat_name_entity_list); uint64_t now_us = Time::NowMicros(); stat_total_time_us_ = now_us - last_stat_time_us_; last_stat_time_us_ = now_us; } if (0 != SwitchFile()) { printf("SwitchFile faild!\n"); return; } if (fd_ == NULL) { printf("Couldn't open fd!\n"); return; } std::ostringstream o; o << GetDateString(); o << BuildHeader(); o << BuildBody(stat_name_entity_list); Write("%s\n", o.str().c_str()); // printf("%s\n", o.str().c_str()); o.clear(); } } // namespace wwsearch
THE Guardia Civil stopped three different cars within 24 hours between December 15 and 16 at the Beni-Enzar customs post between Melilla and Morocco and found secret areas in the cars, each containing an African migrant trying to gain entry to Spanish territory. According to the authorities, there is no doubt that these desperate people are paying large amounts of money to organised crime bosses in order to try to enter the European Union. In these cases, the vehicles used were a Ford Fiesta, and two R21 and Renault Laguna models, where secret compartments were concealed behind the dashboard, on the front bumper next to the radiator and behind the rear bumper. Thanks to the knowledge and the alertness of the officers involved, two of the people they discovered, one a young woman, had to be taken urgently to hospital as they were experiencing difficulty breathing, extreme weakness, and loss of consciousness, but it is reported that they are recovering well. In two cases, the drivers managed to flee the area, returning to Morocco although they lost their cars, whilst others were detained, and have been sent to prison. The average charge to each migrant is believed to be in the region of €4,000 which makes the risk worth taking for the drivers and if the migrants die or are caught after arriving in Melilla, it makes little difference to them.
Throughout the last week, Arsenal Twitter was awash with talk of a fundraising campaign to raise money to fly a plane demanding “Wenger Out” and “No New Contract”. Late on Friday, rumours circulated that due to weather conditions, the plane might not be able to circulate The Hawthornes. During the first half of yesterday’s dismal display, the sound of a small aircraft above the ground seemed to go on forever. Unable to see the plane, I turned to a pal and said “they must have paid for a lot of flight time”. It was only at half time that we were aware that there were two banners. One proclaiming that Wenger should go, the second one declaring that we need to trust and respect Wenger. With the secrecy and surprise of the second banner, there was only one conclusion to be made, that a single individual, or very small group of individuals, had paid for the second plane. Hiring planes is not cheap. The Wenger Out one required a very public crowd funding campaign. The Respect Wenger one had zero publicity. No fundraising campaign. Clearly the actions of of a small group who people who worked in the background, silently, to organise and pay for it. Asked by #WengerMustStay client to point-out that this was funded by a Hong Kong group of fans. 😎 pic.twitter.com/dfd0f2P7Rz — Airads Banners (@AiradsBanners) March 19, 2017 The company who flew the planes confirmed that the second plane was ordered by a company in Hong Kong. Not a surprise that it had been paid for by a couple of rich foreign fans. But further digging has potentially shown something beyond a rich fan wanting to publicaly back Arsenal Wenger. A little research by some Arsenal fans have a uncovered Hong Kong firm called Jardine Matheson Holdings Ltd. A little Wikipedia search on this company shows that Jardine Matheson Holdings are a conglomerate based in, you guessed it, Hong Kong. Closely associated with this company for over 100 years are the Keswick family. Sir Henry Keswick is the chairman. The MD is Ben Keswick, son of Sir Henry’s brother, Simon. The CEO (or DMD) is Adam Keswick. He is the son of Sir Henry’s other brother, Sir John Chippendale Lindley Keswick known as “Chips”. Now the pieces are falling into place. We have a banner paid for in Hong Kong, a Hong Kong company run by the son, brother and nephew of the Chairman of Arsenal. A man who has reportedly previously paid for an anti-Usmanov banner within the Emirates. The second banner and “banner wars” bought a bit of a smile to my face on a dark, dark day. But the fact the second banner could have been bought and paid for by a company with connections to the Chairman of Arsenal Football Club leaves a bitter taste in my mouth. Keenos
About Mathematical Models of Irreversible Polarization Processes of a Ferroelectric and Ferroelastic Polycrystals This chapter presents the prevalent mathematical models of irreversible processes in polycrystalline ferroelectric materials when they are subjected to intense electrical and mechanical influences. The main purpose of such models is to describe the dielectric hysteresis loops, with which the models of Rayleigh and Preisach coped well, though they were developed almost a 100 years ago. Nevertheless, in order to describe the whole gamut of material properties in irreversible polarization-depolarization processes, it was required in the last three decades to develop new approaches and methods that take into account the material structure and the physics of the process. In this chapter, we attempted to collect the most common one-dimensional models, with a view to give a brief description of the basics and approaches with the application of working formulas, algorithms and graphs of numerical calculations. On one-dimensional models, the basics of three-dimensional models are worked out, such as evolutionary laws, domains switching criteria, generalizations from hysteron to the polarization surface, and so on, so they are a necessary step in modeling. However, some of them proved to be so effective that they obtained the right to independent existence, as happened with the Preisach model, which found application in dynamic systems. This research is based on published articles, monographs, proceedings of conferences, and scientific reports of individual collectives published over the past 20 25 years. of polycrystalline ferroelectric media on the external effects of high-intensity electric and mechanical fields are considered. The bases of construction of each model are disassembled. The fundamentals of the construction of each of the well-known Rayleigh models, evolution models, models of plasticity theory, Preisach models, models of orientation switching, energy switching models, the Giles-Atherton model are analyzed and the results of their work in the form of hysteresis loops are presented. The main
<reponame>iStig/CapitalVueHD<gh_stars>0 // // NormalCell.h // CapitalVueHD // // Created by jishen on 10/29/10. // Copyright 2010 SmilingMobile. All rights reserved. // #import <UIKit/UIKit.h> @interface NormalCell : UITableViewCell { UILabel *titleLabel; UIImageView *delimiter; UILabel *valueLabel; } @property (nonatomic, retain) IBOutlet UILabel *titleLabel; @property (nonatomic, retain) IBOutlet UIImageView *delimiter; @property (nonatomic, retain) IBOutlet UILabel *valueLabel; @property (nonatomic, assign) CGFloat cellHeight; @property (nonatomic, assign) CGFloat titleIndent; @end
from django.core.management.base import BaseCommand, CommandError from weather.utils import location class Command(BaseCommand): help = "Updates the long range forecasts. Run daily." def handle(self, *args, **options): location.get_forecast(location.get_location())
Having lost original cast members Grace Park and Daniel Dae Kim earlier this month, after the pair’s attempts to negotiate equal pay with co-stars Alex O’Loughlin and Scott Caan were ultimately rejected by CBS, Hawaii Five-0 has refilled its roster with other, presumably less potentially expensive stars. Deadline reports that the show has bumped Ian Anthony Dale up to series regular on the Hawaiian cop show, and added Meaghan Rath and Beulah Koale to its incoming ranks. Dale has been a recurring guest star on the series since its second season. (Somewhat awkwardly, his character, crime lord and informant Adam Noshimuri, is married to Park’s departing Kono Kalakaua.) Meanwhile, Rath—who’s probably best known for starring in the U.S. version of Being Human—will play a new rookie cop that O’Loughlin’s McGarrett discovers while she’s working as a lifeguard, and Koale will play a Navy SEAL hoping to apply his skills to the Five-0 team. Hawaii Five-0 returns for its eighth season on September 29.
Biological therapy for psoriasis: an overview of infliximab, etanercept, efalizumab and alefacept. Psoriasis is a chronic skin disorder that affects approximately 2% of the US and European population. Over the last several years one of the major foci in psoriasis research has been the development of biological therapies for this disease. The aim of these therapies is to provide selective, immunologically directed intervention with fewer side effects than traditional therapies. This article will review the progress of four biological agents that are available or under investigation for clinical use: infliximab (Centocor Inc), etanercept (Amgen Inc/Wyeth), efalizumab (Genentech Inc/XOMA Ltd/Serono SA) and alefacept.
package mecca.meccurator; import java.math.BigDecimal; /** * Each bid is associated with a bid list and this bid list is associated with one art item. */ public class Bid { protected String bidder; protected float rate; /* each bid has a bidder who made the bid and a rate */ public Bid(String bidder, float rate) { this.bidder = bidder; this.rate = round(rate); } public String getBidder() { return bidder; } public void setBidder(String bidder) { this.bidder = bidder; } public float getRate() { return rate; } public void setRate(float rate) { this.rate = round(rate); } @Override public String toString(){ // Right, now this is customized for the MyListingsActivity's All listings listview //TODO customize this for the listview calling it // ie. some listviews should show different attributes return bidder + ": " + "$" + rate; } /** * method taken from http://stackoverflow.com/questions/8911356/whats-the-best-practice-to-round-a-float-to-2-decimals on Apr-04-16 * @param price to be rounded * @return rounded price */ public static float round(float price) { return BigDecimal.valueOf(price).setScale(2,BigDecimal.ROUND_HALF_UP).floatValue(); } }
#pragma once #include <objbase.h> #include <stdexcept> #include <string> namespace agc { void comcheck(HRESULT result); class ComException : public std::runtime_error { public: ComException(HRESULT result) : std::runtime_error(std::string("COM exception ") + std::to_string(result)) { } }; /** Scoped COM Library initializer */ class Com { public: Com() { comcheck(CoInitialize(NULL)); } ~Com() { CoUninitialize(); } }; }
export * from '@fluentui/date-time-utilities/lib-commonjs/dateMath/dateMath'; export * from '@fluentui/date-time-utilities/lib-commonjs/dateValues/dateValues'; export * from '@fluentui/date-time-utilities/lib-commonjs/dateValues/timeConstants';
<reponame>yiminyangguang520/shiro-sample<filename>spring-boot-shiro-jwt-wechat-applet-sample/src/main/java/name/ealen/infrastructure/exception/ControllerExceptionAdvice.java package name.ealen.infrastructure.exception; import com.alibaba.fastjson.JSON; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import name.ealen.infrastructure.util.HttpUtil; import name.ealen.infrastructure.util.TimeUtil; import org.apache.shiro.authc.AuthenticationException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpServerErrorException; /** * * @author EalenXie * @date 2018/11/8 16:25 * 全局异常 及其自定义异常 返回处理 */ @ControllerAdvice public class ControllerExceptionAdvice { private final Logger log = LoggerFactory.getLogger(ControllerExceptionAdvice.class); @ExceptionHandler(value = Throwable.class) public ResponseEntity Throwable(Throwable throwable, HttpServletRequest request) { Map<String, String> resultMap = getThrowable(throwable); if (request != null) { Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code"); resultMap.put("Requester-Ip", HttpUtil.getIpAddress(request)); resultMap.put("Requester-Agent", request.getHeader("user-agent")); if (statusCode != null) { new ResponseEntity<>(JSON.toJSON(resultMap).toString(), HttpStatus.valueOf(statusCode)); } } return new ResponseEntity<>(JSON.toJSON(resultMap).toString(), HttpStatus.INTERNAL_SERVER_ERROR); } @ExceptionHandler(value = AuthenticationException.class) public ResponseEntity AuthenticationException(AuthenticationException serverError) { Map<String, String> resultMap = getThrowable(serverError); return new ResponseEntity<>(JSON.toJSON(resultMap).toString(), HttpStatus.UNAUTHORIZED); } @ExceptionHandler(value = HttpServerErrorException.class) public ResponseEntity HttpServerErrorException(HttpServerErrorException serverError) { Map<String, String> resultMap = getThrowable(serverError); HttpStatus status = serverError.getStatusCode(); resultMap.put("responseBody", "" + serverError.getResponseBodyAsString()); resultMap.put("statusCode", "" + status.toString()); resultMap.put("statusText", "" + serverError.getStatusText()); resultMap.put("statusReasonPhrase", "" + status.getReasonPhrase()); return new ResponseEntity<>(JSON.toJSON(resultMap).toString(), status); } @ExceptionHandler(value = HttpClientErrorException.class) public ResponseEntity HttpClientErrorException(HttpClientErrorException clientError) { Map<String, String> resultMap = getThrowable(clientError); HttpStatus status = clientError.getStatusCode(); resultMap.put("responseBody", "" + clientError.getResponseBodyAsString()); resultMap.put("statusCode", "" + clientError.getStatusCode().toString()); resultMap.put("statusText", "" + clientError.getStatusText()); resultMap.put("statusReasonPhrase", "" + status.getReasonPhrase()); return new ResponseEntity<>(JSON.toJSON(resultMap).toString(), status); } /** * 公共异常信息 */ private Map<String, String> getThrowable(Throwable throwable) { Map<String, String> resultMap = new HashMap<>(4); resultMap.put("throwable", "" + throwable); resultMap.put("throwableTime", "" + TimeUtil.getCurrentDateTime()); resultMap.put("message", "" + throwable.getMessage()); resultMap.put("localizedMessage", "" + throwable.getLocalizedMessage()); log.error("Exception : {}", JSON.toJSON(resultMap)); throwable.printStackTrace(); return resultMap; } }
/** * A private method that adds a name (String or byte array) to the * issuerNames criterion. The issuer distinguished * name in the {@code X509CRL} must match at least one of the specified * distinguished names. * * @param name the name in string or byte array form * @param principal the name in X500Principal form * @throws IOException if a parsing error occurs */ private void addIssuerNameInternal(Object name, X500Principal principal) { if (issuerNames == null) { issuerNames = new HashSet<Object>(); } if (issuerX500Principals == null) { issuerX500Principals = new HashSet<X500Principal>(); } issuerNames.add(name); issuerX500Principals.add(principal); }
Understanding the Osteosarcoma Pathobiology: A Comparative Oncology Approach Osteosarcoma is an aggressive primary bone tumor in humans and is among the most common cancer afflicting dogs. Despite surgical advancements and intensification of chemo- and targeted therapies, the survival outcome for osteosarcoma patients is, as of yet, suboptimal. The presence of metastatic disease at diagnosis or its recurrence after initial therapy is a major factor for the poor outcomes. It is thought that most human and canine patients have at least microscopic metastatic lesions at diagnosis. Osteosarcoma in dogs occurs naturally with greater frequency and shares many biological and clinical similarities with osteosarcoma in humans. From a genetic perspective, osteosarcoma in both humans and dogs is characterized by complex karyotypes with highly variable structural and numerical chromosomal aberrations. Similar molecular abnormalities have been observed in human and canine osteosarcoma. For instance, loss of TP53 and RB regulated pathways are common. While there are several oncogenes that are commonly amplified in both humans and dogs, such as MYC and RAS, no commonly activated proto-oncogene has been identified that could form the basis for targeted therapies. It remains possible that recurrent aberrant gene expression changes due to gene amplification or epigenetic alterations could be uncovered and these could be used for developing new, targeted therapies. However, the remarkably high genomic complexity of osteosarcoma has precluded their definitive identification. Several advantageous murine models of osteosarcoma have been generated. These include spontaneous and genetically engineered mouse models, including a model based on forward genetics and transposon mutagenesis allowing new genes and genetic pathways to be implicated in osteosarcoma development. The proposition of this review is that careful comparative genomic studies between human, canine and mouse models of osteosarcoma may help identify commonly affected and targetable pathways for alternative therapies for osteosarcoma patients. Translational research may be found through a path that begins in mouse models, and then moves through canine patients, and then human patients. Introduction Osteosarcoma is an aggressive primary bone tumor most prevalent in human patients. It mostly occurs during adolescence, with a second peak at middle age (older than 40). The tumor is characterized by increased production of osteoid (abnormal bone matrix) and by exceptionally complex karyotypes. While the target cell for malignant transformation in the formation of osteosarcoma is not known with certainty, it is thought to be a mesenchymal stem cell (MSC) or a cell committed to the osteoblast lineage. Evidence from mouse models indicates that any of several cell stages could serve as target cells for osteosarcoma development. There are three common histologic types of osteosarcoma: osteoblastic, where tumor cells produce large amounts of tumor osteoid; chondroblastic, where tumor cells produce chondroid (cartilage) in addition to some amount of tumor osteoid; and fibroblastic, where tumor cells are predominantly fibroblasts and can produce both collagen and tumor osteoid. The disease is highly metastatic, with distant spread mostly to lungs and other sites in bone, but osteosarcoma can also metastasize to lymph nodes and intra-abdominal organs. The metastatic pattern (lungs, bones, lymph nodes) is similar for dogs and humans. Osteosarcoma may present with macroscopic metastatic disease or metastatic disease can occur after therapy. In either case, prognosis is significantly worse once metastasis has been detected. In canine patients, osteosarcoma is a disease primarily of adult dogs; the median age at diagnosis is approximately eight years, with a small peak of incidence in young animals (younger than 3 years). This differs from the situation in human patients where the peak age of incidence is in adolescence. Nevertheless, the natural history of the disease is similar in canine and human osteosarcoma patients. Moreover, we have observed that genome wide expression profiles of canine osteosarcoma are indistinguishable from human pediatric osteosarcoma and more like human osteosarcoma than any other human cancer. In dogs, there is generally a strong breed preference in the risk for cancer, such as osteosarcoma. Many large breed dogs have an increased risk for osteosarcoma compared to other breeds. The genetic determinants of osteosarcoma susceptibility in dogs are not fully elucidated, and it is possible that these factors will also be important in human osteosarcoma susceptibility. The development of treatment strategies in dogs and people has proven mutually beneficial for both species. In fact, current treatment options are similar in both species. Osteosarcoma is treated using surgery, radiation and chemotherapy. Surgical techniques have greatly improved with time, and in many cases limb salvage is feasible with low rates of local recurrence in humans. Combination chemotherapies are vital for effective treatment of osteosarcoma. However, despite decades of effort, nothing better than the most often used combination of three chemotherapeutic agents (i.e., methotrexate, doxorubicin and cisplatin) has been found.The adjuvant chemotherapy is generally administered prior to surgery and, according to many studies, the extent of necrosis observed in the primary tumor after surgical removal is correlated with the outcome.. The goal of the adjuvant chemotherapy is to eliminate the micrometastases that are thought to be present in >80% of all patients at the time of diagnosis, thus preventing relapse. New research is underway to define specific molecular targets that could be utilized to treat this disease, but their elucidation has been proven difficult. It is possible that osteosarcoma may also be treated using recently developed immunotherapies, such as immune checkpoint blockade or chimeric antigen receptor-engineered T cells. Osteosarcoma is characterized by aneuploidy and extensive genetic instability. Due to this extreme genetic instability, common causes of osteosarcoma development have largely been limited to implicating loss of RB and TP53 regulated cellular activities and upregulation of MYC transcriptional activity reviewed by Morrow et al.. Beyond these, few alterations are common or well accepted as osteosarcoma drivers. Gene amplification and protein overexpression of the RUNX2 transcription factor, which is a regulator of bone renewal, has been proposed to drive osteosarcoma. Conflicting data on activation of beta-catenin dependent transcription in osteosarcoma has been reported. In addition, TGF- signaling has been proposed to promote the acquisition of metastatic disease. Notable, expression of Ezrin at high levels has been found in metastatic human and canine osteosarcoma and functionally validated in model systems as a driver of osteosarcoma metastasis. Recently, a large scale Sleeping Beauty (SB) transposon-based forward genetic screen was carried out for osteosarcoma in mice. From this screen, a large number of new candidate osteosarcoma proto-oncogene and tumor suppressors were reported. These included the candidate oncogenes SEMA4D and SEMA6D, which were partially functionally validated as well as tumor suppressors like NF1, NF2 and PTEN. Beyond protein encoding genes, several micro RNAs (miRNAs) and miRNA clusters have been suggested as drivers or suppressors of osteosarcoma development and progression. What remains unclear is which common oncogenic drivers for osteosarcoma should be targeted and how they would be targeted. Unlike the case for other malignancies, osteosarcoma is genetically heterogeneous and common molecular targets may not be present. Osteosarcoma is much more common in dogs than in people (greater than 15 times) and can be experimentally induced in mice via transgenesis. Perceivably, the opportunity to study osteosarcoma in three different species may make it possible to identify core genes and pathways, whose alterations are central to the osteosarcoma phenotype and that would make good targets for therapy. In the past, the main challenges were the development of improved surgical techniques for limb salvage, prevention of local recurrence and the identification of effective combination chemotherapies. Currently, a major pressing need is the development of new therapies to prevent the outgrowth of metastatic disease and to treat it once it has occurred. It is possible that germline or somatic mutations or tumor gene expression signatures identified through multi-species approaches could help predict which patients will respond well to current treatment regimes and which need to be referred for more intensive therapy or follow-up screening. However, much remains to be learned about what allows microscopic osteosarcoma lesions to resist chemotherapy and to suddenly break tumor dormancy and form a macroscopic mass. Until these questions are answered, we are not fully capable to help many human and canine osteosarcoma patients. This review is an attempt to address many of the unanswered questions pertaining to osteosarcoma by focusing on recently acquired knowledge from a multi-species approach. Human Osteosarcoma Osteosarcoma in human patients is a rare tumor with a peak incidence in the second decade of life. The incidence is roughly 25 cases per 10 million per year in the United States. A second wave of osteosarcoma is diagnosed in individuals between 70 and 80 years of age, often in association with Paget's disease. Paget's disease is an abnormality of bone homeostasis in which excessive bone reabsorption and reformation occur. Genetic and viral origins of Paget's disease have been suggested. While osteosarcoma is a rare manifestation of the disease, risk for osteosarcoma is increased. Osteosarcoma can occur in nearly any part of the skeleton, but commonly affects one of the long bones. As it occurs during a period of intense bone growth, there may be an association between this growth and sensitivity to osteoblast transformation. Indeed, children with osteosarcoma are on average tall for their age. Genetic studies also have suggested an association between the inheritance of certain forms of growth control genes and risk for osteosarcoma. Other risk factors for human osteosarcoma include prior radiation therapy, male gender, and possibly African ancestry. A genome-wide association study (GWAS) revealed possible risk alleles in the glutamate receptor, metaotropic 4 (GRM4) gene and a gene desert at chromosome 2p25.2. A recent GWAS also identified a potential high-risk allele for osteosarcoma metastasis at presentation within the transcriptional activator NFIB, a gene that was also identified as a potential tumor/metastasis suppressor in a transposon-based genetic screen in mice. Some rare inherited cancer predisposition syndromes increase the risk for osteosarcoma. These rare cancers include Li-Fraumeni syndrome, hereditary retinoblastoma and Rothman-Thompson syndrome caused by germline mutations in TP53, RB1, and RECQL4, respectively. Certain other cancer predisposition syndromes also seem to increase the risk of osteosarcoma development including Neurofibromatosis Type 1 syndrome, Werner's syndrome and Diamond-Blackfan anemia. Patients with hereditary multiple osteochondromas, due to inheritance of mutations in the EXT1 or EXT2 genes, are predisposed to development of osteosarcoma also. Human osteosarcoma is typically diagnosed due to swelling and pain often in the limbs. This can cause a limp if the involved limb is a leg or immobility of a joint. Pain may be constant or associated with exertion. In rare cases osteosarcoma will trigger a bone fracture. Diagnosis is made following a complete medical exam and imaging studies. Often an X-ray is done, followed by positron emission tomography or a bone scan. As osteosarcoma can often metastasize to the lungs, lung X-rays are utilized. A definitive diagnosis requires a biopsy. Staging of osteosarcoma is controversial. Most believe that all osteosarcoma should be considered high grade and treated as such although low grade osteosarcoma seems to be a distinct entity. The only commonly accepted staging is localized versus metastatic disease. Human osteosarcoma is commonly treated using surgery and chemotherapy. Chemotherapy for roughly ten weeks that precedes surgery and the extent of necrosis in the surgically removed primary tumor has been suggested to be associated with long term risk for disease recurrence. Chemotherapy is also given after surgery for a period of up to a year. Usually two or three chemotherapeutic agents are given for osteosarcoma treatment. Common combinations include high-dose methotrexate, doxorubicin and cisplatin (sometimes with ifosfamide); doxorubicin and cisplatin; ifosfamide and etoposide; ifosfamide, cisplatin (or carboplatin) and epirubicin. Radiation therapy is used in some cases for non-resectable tumors. The prognosis of human osteosarcoma is affected largely by the presence or absence of metastases. The 5-year survival rate for localized osteosarcoma is estimated to be between 50% and 60%. For metastatic disease the 5-year survival rate is 15% to 30%. There is a better prognosis if metastatic osteosarcoma is present only in the lungs and is all metastatic lesions can be removed surgically. That said, there is a dire need to develop therapies that can be used to treat patients who present with extensive metastatic disease or who recur with metastatic disease. At present, palliative care is often used in such cases or referral for clinical trials. Canine Osteosarcoma Canine osteosarcoma accounts for 80%-90% of canine primary bone tumors. Dogs often present with a history of lameness or in some cases with a pathologic fracture of the affected bone. Diagnosis is based on clinical signs, imaging and biopsy. The metaphyseal region of long bones is the most common primary site with front limbs affected twice as often as rear limbs and the distal radius and proximal humerus being the two most common locations. It is believed that external factors such as chemical carcinogens, ionization radiation, metallic implants to fix fractures and precedent skeletal disorders such as osteomyelitis and microscopic fractures can lead to canine osteosarcoma. There are implications of genetic factors such as TP53 and RB1 aberrations, as well as certain viruses and growth factor alterations. Osteosarcoma can affect any breed of dog, but it is more commonly found in the larger breeds. Some breeds, such as the Scottish Deerhound, Great Dane, St. Bernard and Greyhound, are at high risk for developing primary bone tumors suggesting a genetic predilection. In fact, the CDKN2A locus has been recently linked to osteosarcoma risk in dogs, and the risk allele is fixed in certain breeds like Rottweilers and Irish Wolfhounds. Without treatment, the estimated survival for a dog with osteosarcoma is less than 3 months. On the other hand, survival times of approximately 1 year (or about 10% of a dog's lifetime) are achievable for 20%-50% of dogs with osteosarcoma treated using the current standard of care, and a small percentage of dogs can survive up to 5-6 years after diagnosis. Standard of care for dogs is surgery (amputation of limb sparing surgery) with adjuvant chemotherapy. The choice of chemotherapy drugs does not seem to influence survival, thus, toxicity, quality of life and cost tend to be the factors that guide treatment decisions. Chemotherapy is only recommended when the primary tumor is removed and as of current, the drug of choice is carboplatin. Many well-controlled studies show that a clinical response for osteosarcoma is only achievable with accepted standard of care. In very rare cases, dogs with osteosarcoma that receive palliative care may have prolonged (>1 year) survival, even in face of metastatic disease. Anecdotal benefits reported from herbal or "alternative" treatments, have not been reproducible, and no alternative therapies have been shown to have efficacy or provide consistent clinical benefit in controlled trials. Metastatic bone cancer is the common cause of death or euthanasia, in 90% of dogs by 1 year. Reducing the primary tumor's ability to metastasize and enhancing the antitumor activity of chemotherapy drugs and yet having minimal negative side effects is still a challenge for veterinary practitioners. Treatment options for canine patients with metastases include pulmonary metastasectomy, but treatment for metastatic disease is only recommended if the primary tumor remains in complete remission. The median survival after pulmonary metastasectomy can be up to 6 months; but without standard surgical procedure, survival outcome is usually less than 2 months. Mouse Models of Osteosarcoma The number of genetically engineered or other mouse models of osteosarcoma are fairly restricted. However, these have been useful for studies on the cell of origin for osteosarcoma development and gaining insight into new genes and pathways that influence osteosarcoma initiation, progression and the process of metastasis. Most of the reported models utilize Cre/LoxP mediated deletion of Trp53 and/or Rb1 (reviewed in ). A few other models have been created by transgenic overexpression of various oncogenes including Fos and SV40 large T antigen, or co-deletion of one copy of Twist and mutation of Apc. Osteosarcoma can be induced with high efficiency in mice by osteoblast lineage specific deletion of the Trp53 gene, although the latency and penetrance is greatly enhanced by co-deletion of both copies of the Rb1 gene.These data are consistent with the centrality of TP53 and RB1 loss of function alterations in human osteosarcoma. Mouse osteosarcoma induced by deletion of Trp53 is genomically unstable, as is seen in human osteosarcoma. Others have created mouse cell lines from spontaneously occurring osteosarcoma. In cases in which these osteosarcoma were induced on a uniform strain background, the osteosarcoma cells can be grown in syngeneic hosts by intravenous, subcutaneous, or orthotopic injections into the tibia (reviewed in ). Examples include the K12 and K7M2 derivative that is highly metastatic, and the Dunn along with its metastatic derivative LM8. These cell lines have been useful for testing the role of various components of the immune system on primary osteosarcoma tumor growth and osteosarcoma metastasis. Such cell lines have also been used to create matched pairs of poorly and highly metastatic cell lines for study. These have been useful for developing candidate genes and pathways that may regulate the process of metastasis, such as high-level expression of ezrin. Quist et al. reported that osteosarcoma could be induced in mice via homozygous Cre/LoxP-mediated deletion of Trp53 and Rb1 in undifferentiated mesenchyme, pre-osteoblasts or infrequently cycling mature osteoblasts. These data suggest that a variety of cell types could be targets for osteosarcoma development. This plasticity may also be the basis for the ready acquisition of new osteosarcoma phenotypes in patients, including chemo/radiotherapy resistance and the ability to readily colonize the lung. From osteosarcoma mouse models, we have learned that osteosarcoma cells have a predilection to metastatic colonization of the lung, but, interestedly, have observed a metastatic potential spectrum across various cell lines. Intriguingly, in mouse models of Li-Fraumeni, the rate of lung metastasis is influenced by the nature of the p53 mutant allele used and when in the lifetime of the mouse Cre is used to induce mutation of the p53 gene. The rate of spontaneous development of osteosarcoma and the frequency of lung metastasis is higher in mice heterozygous for the Trp53 R272H allele than in mice heterozygous for the carry Trp53 R270H allele. Recently, a new mouse model of osteosarcoma was developed which utilizes the Sleeping Beauty (SB) transposon mutagenesis system. In this project, a SB transposon vector designed to activate proto-oncogenes or inactivate tumor suppressor genes by insertional mutagenesis, was mobilized specifically in Osx1+ cells using a tissue-specific mutagenesis approach. Mutagenesis by SB was able to induce osteosarcoma in otherwise wild type mice or accelerate osteosarcoma in mice with tissue-specific induction of the Trp53 R270H allele. Transposon insertion mutations in specific regions of the genome are found recurrently in SB induced tumors and these regions are called "common insertion sites" or CIS. CIS result from selection for insertions that occur within or near a cancer gene in the right position and the right orientation so as to give the cell a selective advantage and drive the development of a tumor. Thus, the identification of genes at or near CIS defines new candidate drivers of cancer development. Genomic Alterations It has been reported that genomic alterations are necessary for development of osteosarcoma in mouse models (TP53) and are accepted as being commonly shared in humans and dogs. Highly chaotic karyotypes encompass a key feature that characterizes some mouse models used for osteosarcoma studies, and naturally occurring osteosarcoma in dogs, as well as in human patients. The average human osteosarcoma harbors roughly 30 coding alterations while in dog osteosarcoma and mouse models, this figure is not known with certainty. Many of the candidate genes implicated in the pathogenesis and progression of osteosarcoma in people have also been characterized in the canine disease. Notable examples of these genes are PTEN (phosphatase and tensin homolog), RB1 (retinoblastoma), and TP53 (tumor protein 53), and MET (mesenchymal-epithelial transition factor). Genetic alterations of the retinoblastoma susceptibility (RB1) gene have been implicated in the development and progression of osteosarcoma. In people, almost 70% of osteosarcomas have at least one RB1 gene alteration and the percentage is similar in dog osteosarcomas. We recently reported that an aberrant RB-E2F1 regulatory pathway is predictive of biological behavior. Since our work, another group has reported that RB1 alterations may serve as a prognostic marker for the management of osteosarcoma patients. Approximately 50% of human osteosarcomas have been reported to have somatic TP53 deletions or point mutations detected using exon sequencing strategies. However, a recent study that used whole genome sequencing of human osteosarcomas suggests that nearly all osteosarcoma tumors have p53 pathways lesions, which in many cases are translocations that break in the first intron of TP53 gene. Thus, it would appear that p53 pathway loss might be a requirement for osteosarcoma development in people. Clearly, germline TP53 mutations, which cause Li-Fraumeni syndrome, predispose to osteosarcoma. However, it is unclear whether TP53 mutations act as initiating mutations or progression mutations in sporadic osteosarcoma. In any case, p53 pathway alterations are common in genetically engineered mouse models as well as spontaneous canine and human osteosarcoma. Therefore, mouse models could be used to develop therapies that exploit p53 pathway alterations in patient osteosarcoma. In humans and dogs, several oncogenes have been identified as possibly playing a role in osteosarcoma including MET, FOS, IGF1R (Insulin-Like Growth Factor 1 Receptor), PVT1/MYC, RUNX2, and HER2. Some of these changes involve copy number alterations. Consistent genome and chromosome copy number changes have been reported in canine and human osteosarcoma. For instance, a high copy number gain of the RUNX2 locus has been reported in both human and dog osteosarcoma. Some of these genes, or the pathways they regulate, including the PVT1/MYC locus, MET signaling, and IGF1R have been implicated in genetically engineered mouse models of osteosarcoma. Recurrent point mutations have been observed in osteosarcoma, but there are few beyond RB1 and TP53 that reach statistical significance. This is in part because too few samples have been sequenced. However, point mutations or deletions of several tumor suppressor genes, likely to be drivers of osteosarcomagenesis, were observed in a recent report of human osteosarcoma including NF1, NF2 and PTEN, all of which were also recovered in a transposon-based screen for osteosarcoma in mice. Overlap exists between other reported candidate human osteosarcoma genes after genome-wide copy number and whole exome sequencing were done, and also after transposon based screening in a mouse model including activation of PI3KCA, and AKT1, and inactivation of ARID1A. One of the earliest studies reported four differentially expressed miRNAs in a handful of osteosarcoma samples compared to controls. Since these initial studies, additional research has shown that miRNA deregulation is potentially central to osteosarcoma development and progression. Indeed, our group generated a Sarcoma MicroRNA Expression Database (S-MED) that represents 22 different sarcoma types, including osteosarcoma. Through S-MED we found that osteosarcoma clustered separately from all other sarcoma types indicating the presence of potentially biologically important miRNAs. One of the unique miRNA signatures we found revealed the significant downregulation of around 50 miRNAs in the human 14q32 locus compared to the controls. Most importantly, we have also shown a comparable decrease in expression of orthologous 14q32 miRNAs in canine osteosarcoma samples. Interestingly we did not observe any copy number changes at the 14q32 locus, suggesting epigenetic changes at the locus. We confirmed that subset of these 50 miRNAs (miR-382, miR-369-5p, miR-544 and miR-134) could target the 3 1 UTR of cMYC transcript. Additionally, overexpression of these miRNAs in osteosarcoma cells decreased the cMYC levels and induced apoptosis. Also cMYC has been shown to transactivate a commonly known miRNA cluster, miR-17-92. We showed that restoration of the 14q32 miRNAs not only did decrease the cMYC levels but also significantly reduced the levels of mir-17-92. The role of miRNAs in canine osteosarcoma remains to be fully elucidated. Since the discovery of miRNAs, there have been few studies that show a correlation between deregulation of miRNAs and canine osteosarcoma. A recent study investigated the role of miR-196a and its target Annexin V in human (143B, MG63) and canine (DAN) osteosarcoma cell lines to identify potential targets for new therapeutic agents in both the species. They observed that miR-196a is downregulated in many of the canine osteosarcoma tumors compared to the normal bone, which is in contradiction with some earlier studies. Further studies need to be performed on a larger cohort to establish that miR-196a is a potential therapeutic target and can impact multiple downstream targets in canine osteosarcoma. A study led by Fenger et al., sought to characterize miRNA expression in canine primary tumors among the major large breeds (greyhounds, rottweilers, golden retrievers and some mixed breeds). Using Nanominer software, they determined 189 miRNAs that were differentially expressed. Of these, miR-494 was highly expressed in all the breeds compared to normal canine osteoblasts. As mentioned earlier, our group was among the first groups to observe a significant downregulation of around 50 miRNAs in the human 14q32 chromosomal region, which was highly conserved in the dog genome. Out of the 50 miRNAs, 2 miRNAs, miR-134 and mir-544, shared 100% conservation with the canine genome and mapped to the predicted synteny in canine osteosarcoma. We have comprised a table of key miRNAs that play an important role in survival outcome and chemoresponse that can potentially lead to osteosarcoma diagnosis, subtyping and therapeutics in human and canine osteosarcoma (Table 1). Epigenetic Changes in Osteosarcoma Most forms of human cancer have changes in the epigenome compared to the normal cellular counterparts from which they are derived. Indeed, changes to the epigenome seem to be a ubiquitous feature of cancer. Epigenetic changes are revealed in alterations to the pattern of DNA methylation, histone modifications and nucleosome remodeling (reviewed in ). Osteosarcoma, like other forms of human cancer, seems to have many such epigenome changes compared to normal osteoblasts, the presumptive target cell for transformation. Several studies have analyzed the epigenome in a genome-wide manner, albeit with low numbers of cases. These studies confirm that specific methylation events are heterogeneous among different cases of human osteosarcoma and that these differences may help explain differences in the clinical behavior of different osteosarcomas. These genome wide studies in human osteosarcoma have been restricted to the study of DNA methylation. Work on other chromatin modification remains to be done. The study of genome wide epigenetic changes has not been undertaken on a large scale in genetically engineered mouse models or canine osteosarcoma samples. Many studies in osteosarcoma have focused on methylation of specific genes or gene regions. These studies suggest that certain genes and genetic pathways are subject to control by DNA methylation and attendant modifications to the histone code. Among these are alterations to the RB and p53 pathways. While these specific genes are not frequent targets of methylation based gene silencing, genes in these pathways have been reported as targets for pathogenic methylation. Specifically the CDKN2A locus, encoding the cyclin dependent kinase inhibitor p16 INK4a and the Mdm2 inhibitor p14 Arf, has been reported. Several genes that are targets of p53, or modulate p53 activity, have been shown to be methylated and silenced in osteosarcoma cell lines or xenograft tumors including CDKN1A, HIC1 and GADD45. Many other tumor suppressor genes are silenced by promoter hypermethylation in osteosarcoma cell lines including RASSF1A, TIMP3, DAPK1 and others (review in Morrow and Khanna, Critical Reviews in Oncogenesis, 2015). Methylation and silencing of tumor suppressive miRNA genes has also been observed as specific events in human osteosarcoma cell lines and primary tumors. Promoter hypomethyation, and probable overexpression, of oncogenes is less well studied in osteosarcoma, but several reports have been made suggesting such a mechanism, notably for the metastasis promoting gene IRX1 and the growth factor gene IGF2. Several candidate osteosarcoma oncogenes found in a transposon-based forward genetic screen in mice are also hypomethylated and overexpressed in human osteosarcoma compared to normal osteoblasts, including SEMA4D, RAF1 and PAK1. Some of these epigenetic changes, including aberrant repression and activation, are associated with loss of imprinting control at specific loci in osteosarcoma cells. Genome wide studies of epigenetic alterations in human osteosarcoma need to incorporate many more samples before we learn to what extent they may explain molecular subtypes and clinical behavior of different cases. No such studies have been reported for canine osteosarcomas or mouse models either. When they are, they will allow cross-species comparisons that could help reveal the most meaningful alterations. Despite these limitations, it is apparent that osteosarcoma development is accompanied by changes to the epigenome that drive progression and confer specific cancer phenotypes. Published data does suggest that epigenome targeted therapies, including histone deacetylase inhibitors and DNA demethylating agents, can alter gene expression and inhibit osteosarcoma growth and/or metastasis. Indeed, one study suggests that osteosarcoma cell lines can be reprogrammed using induced pluripotency genes and that the accompanying epigenetic changes reduce tumorigenic potential. Taken together, these data suggest that modification of osteosarcoma epigenomes will be a useful therapeutic approach. Advantages of A Multi-Species, Comparative Osteosarcoma Study Approach Using comparative genetic studies in multiple organisms, it is possible to understand more about the inherited and somatically acquired genetic alterations that are informative of osteosarcoma risk and clinical behavior, especially metastasis. It is reasonable that genetic alterations that are present in human, dog, and mouse osteosarcomas represent the most likely true drivers of osteosarcoma progression, based on the concept of convergent evolution. Singly, mouse models offer opportunities to discover new genes and pathways important in disease initiation and progression. Dogs bring many other advantages to the table. Notably, since they show remarkable intra-breed homogeneity, which, together with noticeable interbreed heterogeneity, the dog offers distinctive opportunities to understand the genetics underlying osteosarcoma. Taken all together, an interspecies approach offers a possibly broader view and understanding of osteosarcoma since, for example, what is found to be altered at the genetic level in one species may be epigenetically silenced altered in another, but would be hard to pick out based on changes to gene expression alone. Findings from mouse models and naturally occurring osteosarcoma in dogs need to be translated into therapeutic approaches in a clinically relevant model. Advantages of clinical trials in dogs are numerous and include that there are many more cases of canine osteosarcoma than human osteosarcoma. In addition, disease progression in dogs, even with standard of care, is rapid so that assessments of improvement can be made in comparatively short periods of time. It has been shown that histological response is not a good predictor (St. Jude, CTOS 20th Annual Meeting) in human osteosarcoma patients, and so there is an urgent need for informative biomarkers. The 14q32 locus is a new and promising marker, which was discovered by our group through a comparative species approach. Conclusions In more than 70% of osteosarcoma patients, current standard-of-care therapies ultimately fail to prevent relapse and metastasis. This dismal outcome has not improved over the past three decades, indicating a desperate need for novel drugs and treatment strategies. As osteosarcoma is genetically heterogeneous, successful therapies will need to target conserved pathobiology. In this review, we discussed the presence of multiple conserved signaling mechanisms as well as some of the approaches for understanding osteosarcoma pathobiology. Recent studies highlight the role of microRNAs in regulation of these conserved signaling pathways. In addition, we have just begun to understand the roles of the regulatory small RNAs and long-noncoding RNAs (lncRNAs). Further, intricacy in gene regulations does not end with identification of regulatory RNAs and its interacting partners. Molecular intricacy is also heavily dependent on our understanding of the implications of other layers of gene regulation such as role for competing endogenous RNAs along with pseudogenes, circular RNAs and lncRNAs. Acquiring such breadth and depth of knowledge is critical for developing therapies that will prevent bypass mechanisms of resistance to therapies. Moreover, cell non-autonomous functions of secreted factors such as exosomes are currently being investigated. In addition, emerging concepts of immune regulation by cancer and recent advancements in immunotherapy hold promise for treating and better outcomes in osteosarcoma. Author Contributions: Jyotika Varshney and Subbaya Subramanian developed the concept for the review. Milcah C. Scott and David A. Largaespada provided input in the canine osteosarcoma and epigenetics of osteosarcoma. Conflicts of Interest: The authors declare no conflict of interest.
Grafting of Encapsulated Genetically Modified Cells Secreting GDNF into the Striatum of Parkinsonian Model Rats In order to deliver glial cell line-derived neurotrophic factor (GDNF) into the brain, we have established a cell line that produces GDNF in a continuous fashion by genetic engineering. These cells were encapsulated and grafted into parkinsonian model rats that had received unilateral intrastriatal injection of 6-hydroxydopamine 2 weeks earlier. Neurochemical analysis showed that GDNF has been produced from the capsule for 6 months after grafting and histological analysis revealed good survival of GDNF-producing cells in the capsule 6 months after grafting. The density of nigrostriatal dopaminergic fibers in the striatum as well as the number of dopaminergic cell bodies in the substantia nigra recovered significantly after GDNF-producing cell grafting. These results suggest the possible application of GDNF-producing cell grafting for the treatment of Parkinson's disease.
package io.renren.modules.thr.dao; import io.renren.modules.thr.entity.ThrLicenseDocusEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * 随附单证类型代码表 * * @author chenshun * @email <EMAIL> * @date 2020-01-06 18:13:02 */ @Mapper public interface ThrLicenseDocusDao extends BaseMapper<ThrLicenseDocusEntity> { }
Search for Bursts of Ultra-High-Energy Photons from Astrophysical Sources Abstract The Buckland Park air shower array has been used for some time as an ultra-high-energy gamma-ray telescope operating at photon energies of about 1015 eV. Other such telescopes have reported apparent bursts of events from astrophysical objects under study. We report here searches for UHE bursts from 14 southern hemisphere objects studied in our UHE programme. No conclusive evidence has been found for any UHE burst activity from these sources in the period 1986-1988. There is possible evidence for activity associated with 1700-377 and SN1987A.
/** * Write a 32-bit value to the PCI configuration space. * * @param bus Bus number to write to. * @param dev Device number to write to. * @param func Function number. * @param reg Register to write. * @param val Value to write. */ void platform_pci_config_write32(uint8_t bus, uint8_t dev, uint8_t func, uint8_t reg, uint32_t val) { spinlock_lock(&pci_config_lock); out32(PCI_CONFIG_ADDRESS, PCI_ADDRESS(bus, dev, func, reg)); out32(PCI_CONFIG_DATA, val); spinlock_unlock(&pci_config_lock); }
LONDON — How do you solve a problem like Rupert Murdoch? That’s the issue now facing sections of his media empire after a damning British parliamentary report labeled the powerful press tycoon unfit to run a major international company. A committee of British legislators who have spent months investigating the phone hacking scandal involving one of Murdoch’s leading UK newspaper titles concluded this week with a majority verdict that the 81-year-old was “not a fit person” to be at the helm of News Corp. Their findings grabbed attention not just in the UK but across the Atlantic, where headlines in the New York Times, Washington Post and Murdoch’s own Wall Street Journal must have made uncomfortable reading for News Corp. staff and shareholders. The committee’s judgment carries no threat of sanction, but with lawsuits pending in the US over hacking and the threat of possible prosecution under the powerful Foreign Corrupt Practices Act, it will offer little in the way of reassurance. Having conceded that the British parliamentary inquiry was right to highlight “serious wrongdoings” at the now defunct News of the World title, News Corp. took issue with the “unjustified and highly partisan” verdict on its boss. Murdoch himself issued a statement to staff admitting mistakes but declaring that “our business has never been stronger.” News Corp.’s board also issued a statement saying it had “full confidence” in its CEO and chairman. However, with criticism of Murdoch continuing to mount in the UK, questions were being raised as to what extent the report would harm his business interests both here and in the United States, with some shareholders suggesting it was time to shift power out of Murdoch’s hands. A day after the report, elements of his $50 billion media empire appeared to be attempting to distance themselves from Murdoch, not just by prominently reporting the committee’s scathing assessment, but by explicitly stating their independence of his command. There was speculation that a small surge in News Corp. share prices in the wake of Tuesday’s verdict reflected anticipation that the company would soon divest itself of its troubled UK newspaper titles and set wheels in motion to reduce Murdoch’s influence over the company. Of primary concern in the UK is whether the “not a fit person” verdict will have any impact on a separate inquiry by British communications industry regulator Ofcom over whether News Corp. is a “fit and proper” owner of a lucrative 39.1 percent stake in prominent broadcaster BSkyB. Any decision that would force News Corp. to offload its BSkyB holding would be a considerable blow to the media giant, which had hoped to buy the broadcaster outright but later abandoned the deal after the phone hacking scandal inflamed opposition. On Wednesday, BSkyB’s chief executive, Jeremy Darroch, used the publication of record financial results to disassociate his company from Murdoch and — clearly wary of the threat to its prized broadcast license — talk up its annual $1.6 billion tax contribution to the British economy. “I would emphasize that it’s important to remember that Sky and News Corporation are separate companies,” he told reporters. "We believe that Sky's track record as a broadcaster is the most important factor in determining our fitness to hold a license." Aware of the potential damage his presence could bring to the company, Murdoch’s son James last month stood down as chairman of BSkyB, saying he didn’t want to be a “lightning rod” for criticism over the hacking scandal. Speculation is now mounting over whether the News Corp. brand will also be vulnerable to critical, financial and legal thunderbolts if Murdoch senior resists shareholder efforts to usher him into a backseat role. “I think you have to be careful about extrapolating from what has been an appalling set of circumstances around one newspaper group … to the continuing demise of News Corp.,” said Charlie Beckett, director of Polis, a media and society think tank at the London School of Economics. Beckett said that while the parliamentary verdict would certainly cast a shadow over any News Corp. deals, mergers or takeovers in the future, there was nothing inevitable about the demise of the company or its subsidiaries. Likewise, he said that while there was support for scaling down Murdoch’s control over News Corp., shareholders would also bear in mind the fact that the media tycoon’s sharp business acumen has consistently paid dividends, regardless of any questions of ethical culpability. “There are some people who would welcome the defamiliarization of the company, but you could also argue that this is a guy who has an extraordinary track record on delivering profit,” he told GlobalPost. Beckett said that plans would already have been in place to arrange a succession of command, and while these may now be fast tracked down from five years to two, News Corp. would be unwise to proceed with too much haste.
<filename>best_spoon.py import streamlit as st st. title("Hello World") st.write([3, 5, 9]) st.write("Oh <NAME>")
OTTAWA — The cornerstone of the Liberal campaign platform was a pledge to grow the economy and create jobs by putting more cash into the hands of middle-class Canadians through aggressive new tax measures. But that policy pillar — to be supported by higher tax payments by the country’s biggest wage earners — could be crumbling, less than three months post-election. That’s because delivering on the promise, intended to be “revenue neutral,” is proving much more costly than envisioned when Justin Trudeau was elected prime minister on Oct. 19. For starters, the hoped-for economic climb-back from the oil-plunge-fueled recession in the first half of last year is sputtering and could stall, or possibly go into reverse — undermining Ottawa’s ability to spread the wealth by providing average wage earners with more untaxed dollars to spend or save, or both. Also troublesome, Trudeau’s tax regime for 2016 and beyond could actually lead to a mini-exodus of the country’s top-income professionals — those with annual salaries above $200,000, the threshold for the new, high-income tax bracket — whose taxes would be needed to cover the gap created by the tax cut given to Canadians earning between $45,000 and $90,000 a year. “The typical ‘one per cent’ are in positions that have more mobility in their roles,” says Les Gombik at Caldwell Partners, a global executive recruitment firm in Calgary. “They are typically executives that are making greater dollars, and those are often the types of roles where they could do those types of roles in different markets,” he says, adding that the drop in the value of the loonie compared to the U.S. dollar was already inspiring people to look south of the border. “The tax changes were one more significant catalyst for people to be looking (south),” Gombik says. The cost to the federal government’s middle-class tax-bracket cut has been estimated at $3.5 billion — “and that’s a transfer of $3.5 billion into the hands of households,” says Craig Alexander, vice-president responsible for economic analysis at the C.D. Howe Institute. [np_storybar title=”Top marginal tax rates” link=””] Want to know how your province stacks up? Here are the marginal tax rates for high-income earners across the country in 2016 and 2015 British Columbia — More than $200,000: 47.7%; 45.8% Alberta — $200,000-$300,000: 47%; 40% | More than $300,000: 48%; 40.25% Saskatchewan — More than $200,000: 48%; 44% (threshold began at earnings of $138,586) Manitoba — More than $200,000: 50.4%; 46.4% (threshold began at earnings of $138,586) Ontario — $200,000-$220,000: 51.97%; 47.97% (threshold began at earnings of $150,000) | More than $220,000: 53.53%; 49.53% Quebec — More than $200,000: 53.31%; 49.97% (threshold began at earnings of $138,586) New Brunswick —$200,000-$250,000: 54%; 50% | More than $250,000: 58.75%; 54.75% Nova Scotia — More than $200,000: 54%; 50% (threshold began at earnings of $150,000) Prince Edward Island — More than $200,000: 51.37%; 47.37% (threshold began at earnings of $138,586) Newfoundland — More than $200,000: 48.3%; 43.3% (threshold began at earnings of $175,000) Yukon — $200,000-$500,000: 45.8%; 41.8% | More than $500,000: 48%; 44% Northwest Territories — More than $200,000: 47.05%; 43.05% (threshold began at earnings of $138,586) Nunavut — More than $200,000: 44.5%; 40.5% (threshold began at earnings of $138,586) Source: TaxTips.ca [/np_storybar] “When the (Liberal) plan was originally discussed during the election, there was an expectation that the introduction of the high-income tax bracket would generate revenues to offset the cost of the middle-income tax-bracket cut,” says Alexander, who co-authored of a recent study on government’s tax reform policy. “We argued that there would be a revenue shortfall, that the Liberal Party was over-estimating the amount of money they were going to be able to generate from the higher income-tax bracket.” As of Jan. 1, the federal tax rate on income between $45,282 and $90,563 declined to 20.5 per cent from 22 per cent. For salaries over $200,000, Canadians will now face a federal tax bill of 33 per cent — up from 29 per cent. That hike in federal taxes, when combined with provincial income tax, means many Canadians will now be paying close to or more than 50 per cent tax on their income. The biggest hit will be felt by high-income residents of British Columbia, Manitoba, Ontario, Quebec, New Brunswick and Nova Scotia. And rather than putting more money into government coffers, critics maintain that the Liberal tax changes could add fuel to a brain drain of talent from Canada and weaken the ability to attract high-end foreign workers to this country. For instance, those in the top one per cent “have various legitimate ways” to lessen the impact of those tax changes, or could move to less expensive tax jurisdictions, either within Canada or outside the country — the U.S. being the prime destination, says the C.D. Howe’s Alexander. “These are not just CEOs. Many others are doctors, high-skilled technical employees — such as engineers — along with small- and medium-sized business owners,” he adds. “The increase in taxes on the top one per cent is modest.” Nonetheless, experts as far back as the 1966 Carter Royal Commission Report on Taxation say 50 per cent represents a threshold at which the rate of taxation has a negative effect on a person’s decision to work. “If personal tax rates get too high that is going to be a disincentive in terms of attracting talent to Canada,” says Kevin Dancey, president and CEO of Chartered Professional Accountants of Canada. “This raises the point that there is only ‘just one’ taxpayer in Canada. If the provinces are going to target the top one per cent, and if the national government is going to target the top one per cent, they should really work together to realize there is really only that one taxpayer,” he says. “I think there’s a lot that can be done, but I think it needs a thoughtful, comprehensive look and not just a piecemeal approach.” Dancey adds: “And I’d rather see it done in better co-ordination with the provinces, so that the provinces and the federal government aren’t stepping on each other.” The revenues won’t be as great as previously anticipated … and that shortfall could be even greater It may be an ominous start to the year for Canada, already darkened by even more weakness in the price of crude and a global economy now increasingly threatened by emerging markets, including China — the world’s second-largest economy, after the United States, but now wavering. Juggling how personal taxes are applied may not prove to the best means of defence for Canada at the moment. “The revenues won’t be as great as previously anticipated … and that shortfall could be even greater,” Alexander says. In fact, Alexander points out, Ottawa is already adjusting its expectation to slightly less than $2 billion annually coming from those with the higher incomes — meaning there will be a shortfall of $1.5 billion. “When you take money away from (the) one per cent, and you give it to the rest, you’re spreading it across a very large group of individuals and households. And as a consequence, it’s a very ineffective way of trying to lean against income inequality,” Alexander says. The bottom line, says the Conference Board of Canada’s Matthew Stewart, is that the Liberal tax changes “will pretty much have no effect on the economy.” “And when you take out the income splitting (allowing couples with children to be taxed at lower rates), which is about another $2 billion, it’s actually a net increase in taxes — not a lot, but close to $1 billion a year,” says Stewart, the board’s associate director, responsible for national forecast. Financial Post gisfeld@nationalpost.com Twitter.com/gisfeld
<gh_stars>1-10 package net.inpercima.cryptocheck.model.bitpanda; import java.math.BigDecimal; import lombok.Getter; import lombok.Setter; @Getter @Setter public class BitpandaWalletsTransactionsDataAttributes { /** * api response: {@code amount} * <p> * <pre> * asset: amount of cryptocoins * fiat: amount in euro of this transaction * </pre> * <p> * <p> * example: 100.00 */ private BigDecimal amount; /** * fee of a transaction * <p> * api response: {@code fee} * <p> * example: 2.00 */ private BigDecimal fee; /** * type of transaction * <p> * api response: {@code type} * <p> * asset: buy, sell, deposit, withdrawal, transfer, refund, ico * <p> * fiat: deposit, withdrawal, transfer, refund * <p> * example: deposit */ private String type; /** * status of transaction * <p> * api response: {@code status} * <p> * one of: pending, processing, unconfirmed_transaction_out, open_invitation, finished, canceled * <p> * example: finished */ private String status; /** * date and time of transaction * <p> * api response: {@code time} as object */ private BitpandaTime time; /** * sender of transaction * <p> * api response: {@code from} * <p> * example: Bitpanda */ private String from; }
Dual-Chirped Optical Parametric Amplification: A Method for Generating Super-Intense Mid-Infrared Few-Cycle Pulses High-energy infrared (IR) femtosecond laser sources are important for applications in ultrafast and strong-field laser science; thus, considerable effort has recently been made to develop such laser systems. In this paper, we review our recent work on developing TW-class mid-infrared (MIR) femtosecond laser pulses in the 14 $\mu$m region using a dual-chirped optical parametric amplification (DC-OPA) method. By employing a Ti:sapphire laser with sub-joule energy to pump the DC-OPA system, MIR femtosecond pulses with 100-mJ-class energy are demonstrated. Efficient energy scalability and flexible wavelength tunability in DC-OPA are confirmed experimentally. Different features of DC-OPA from those of conventional OPA and narrow-band pumped optical parametric chirped pulse amplification (OPCPA) are observed. By precisely optimizing the chirps of the seed and pump pulses in the DC-OPA system, bandwidth narrowing of amplified pulses can be minimized in an energy-scaling strategy. Moreover, DC-OPA can be universally employed for the energy scaling of near-IR, MIR, and far-IR pulses, regardless of the type of nonlinear crystal, and is helpful for efficiently generating few-cycle carrier-envelope phase stable IR pulses with TW-class peak power.
Mike Cernovich. Allan Smith/Business Insider Donald Trump Jr. is no fan of some of America's most important news outlets — he's railed against the New York Times, the Washington Post, and CNN for alleged bias against his father. But there is one self-described journalist who the president's son isn't reluctant to praise: Mike Cernovich. "Congrats to @Cernovich for breaking the #SusanRice story. In a long gone time of unbiased journalism he'd win the Pulitzer, but not today!" Trump tweeted. Trump Jr. was impressed by Cernovich's report on Medium that former national security adviser Susan Rice allegedly requested the names of Trump associates whose communications were incidentally collected. Bloomberg View columnist Eli Lake reported similar findings on Monday. Cernovich has long maintained admirers in the Trump orbit — President Donald Trump's former national security adviser praised the commentator's book, "Gorilla Mindset: How to Control Your Thoughts and Emotions, Improve Your Health and Fitness, Make More Money, and Live Life on Your Terms." And Trump Jr. wasn't the only Trump confidante to promote Cernovich this week. On Monday, Trump counselor Kellyanne Conway directed her followers to visit Cernovich's Medium page, where he shared the transcript of his interview on "60 Minutes" about fake news. The promotion immediately alarmed critics. "It's sickening to me that the White House would try to legitimize this pusher of fake news," Vic Berger, a prominent political satirist who has sparred with Cernovich online, told Business Insider. "He has zero credibility. He spends all of his time trying to discredit others with smear campaigns to push whatever narrative it is at the moment. I think Conway and Trump Jr attempting to elevate Cernovich says a lot about Trump's White House and how they will resort to conspiracy theorists of it helps to distract from things that hurt them." Berger has been on a mission to draw attention to Cernovich's controversial statements since becoming the target of the right-wing host's conspiracy theories in November. After the Super Deluxe producer mocked Cernovich in a video, Cernovich accused Berger of being involved in a "potential pedophile group." This kind of exchange was par-for-the-course. The self-described "New Right" commenter rose to prominence in far-right circles online as a provocateur unafraid to engage with enemies, promote conspiracy theories, and spout controversial opinions about gender and identity politics issues. He played a critical role in stoking rumors about Hillary Clinton's health issues during the election, and propagated the ridiculous conspiracy theory that Washington, DC, restaurant Comet Ping Pong was the site of a child sex ring. Cernovich has frequently expressed his opinion about the ways men and women should behave. "Not being a slut is the only proven way to avoid AIDS. If you love black women, slut shame them," he wrote on Twitter in 2016. He's since deleted tweets where he declared that date rape "does not exist," and said he does not care about rape, though he has written blog posts defending his assertion. As the New Yorker noted in October, his early blog posts carried headlines like "Misogyny Gets You Laid." Cernovich often sees journalism as part-reporting, part-trolling and counter-trolling. "It's karma," he told Business Insider when asked a bout conservative backlash to his opinions in January. "I troll, I'm trolled." "That's the thing," he continued. "That's why when people in the media get trolled, and I'm like, 'Well, when you write about people you can f------ ruin a person's life. You got to own that. So if people want to f--- with you, it's only fair.' I definitely deserve to be trolled." For his part, Cernovich has frequently expressed that he does deserve a Pulitzer for his trolling and hypotheses, though he claims he would not want it anyway. Cernovich did not immediately respond to Business Insider's request for comment.
Recurrence based coupling analysis between event-like data and continuous data Extreme events such as earthquakes, tsunamis, heat weaves, droughts, floods, heavy precipitation, or tornados -affect the human communities and cause tremendous loss of property and wealth, but can be related to multiple and complex sources. For example, a flood is a natural event caused by many drivers such as extreme precipitation, soil moisture, or temperature. We are interested in understanding the direct and indirect coupling between flood events with different climatological and hydrological drivers such as soil moisture and temperature.
import java.util.HashMap; import java.util.Map; import java.util.Scanner; /** * @author: zhaoqing * @date: 2018/9/9 * @time: 下午9:37 */ public class AInscribedFigures { public static void main(String[] args) { Map<String, Integer> initMap = new HashMap<>(); initMap.put("1,2", 3); initMap.put("1,3", 4); initMap.put("2,1", 3); initMap.put("2,3", 0); initMap.put("3,1", 4); initMap.put("3,2", 0); Scanner sc = new Scanner(System.in); Integer n = sc.nextInt(); String lastTmp = null; Integer result = 0; Integer s = 0; boolean finite = true; for (int i = 0; i < n; i++) { String str = sc.next(); if (s == 0) { if (str.equals("3")) { s++; } } else { if (s == 1) { if (str.equals("1")) { s++; } else { if (str.equals("3")) { s = 1; } else { s = 0; } } } else { if (s == 2) { if (str.equals("2")) { s = 0; result--; } else { if (str.equals("3")) { s = 1; } else { s = 0; } } } } } if (i == 0) { lastTmp = str; } else { if (str.equals(lastTmp)) { finite = false; break; } else { if (initMap.get(lastTmp + "," + str) == 0) { finite = false; break; } else { result += initMap.get(lastTmp + "," + str); lastTmp = str; } } } } if (finite) { System.out.println("Finite"); System.out.println(result); } else { System.out.println("Infinite"); } } }
Regulatory Failures and Regulatory Solutions: A Characteristic Analysis of the Aftermath of Disaster This article analyzes the regulatory reform and implementation process in Australia following three event clusters: an industrial explosion, recent terrorist attacks, and a corporate collapse. The research employed a characteristic analysis where the compliance challenge on the ground is understood as affected not only by the enforcement efforts of the regulator, but also the reform process and the structure of the industry concerned. In each of the cases studied, preferred reforms could be understood as metaregulatory and framed around outcomes, principles, and processes rather than a preoccupation with adherence to prescriptive rules. Metaregulation was seen as the most appropriate regulatory framework to maintain the integrity between regulatory goal, regulatory regime, and compliance behavior. Yet, reform pressures that shaped the causal narrative associated with the particular risk, the emotional work involved in compliance, and success strategies of sites all affected what risks were actually reduced and hence the likelihood of a repeat disaster.
Auditor General Bonnie Lysyk found long wait times for key biopsies to diagnose cancer, with only 46 per cent performed within the Ministry of Health's 14-day target. TORONTO – Long waits for a key cancer diagnosis procedure, underuse of radiation therapy and expensive trips to the United States for stem cell transplants are some of the health-care issues being highlighted by Ontario’s auditor general in her annual report. Part of the report released today looks at Ontario’s $1.6-billion annual cancer care system, concluding that while most patients are well-served, long waits for certain procedures and inefficiencies related to others remain in some areas of care. Auditor General Bonnie Lysyk found long wait times for key biopsies to diagnose cancer, with only 46 per cent performed within the Ministry of Health’s 14-day target. The report says a provincial target to provide radiation therapy in 48 per cent of cancer cases has not been met, with 39 per cent of patients actually receiving the treatment in 2015-2016. The report also noted that the government is spending millions to send cancer patients to the United States for stem cell transplants because of limited capacity to perform the procedure in Ontario. The report also says the full cost of cancer drugs is not covered for patients if they are not administered in hospital. In British Columbia, Alberta, Saskatchewan and Manitoba such drug coverage is provided regardless of where the drugs are taken. Cancer is the leading cause of death in Ontario, with more than 29,000 deaths in 2016 attributed to illness. The government estimates that about half of all Ontario residents will develop cancer in their lifetime and one in four will die from it.
// DeleteInstance deletes instance from Azure func (a *Azure) DeleteInstance(ctx *lepton.Context, instancename string) error { vmClient := a.getVMClient() ctx.Logger().Infof("Getting vm with ID %s...", instancename) vm, err := a.GetVM(context.TODO(), instancename) if err != nil { return err } ctx.Logger().Infof("Deleting vm with ID %s...", instancename) future, err := vmClient.Delete(context.TODO(), a.groupName, instancename) if err != nil { ctx.Logger().Error(err) return errors.New("unable to delete instance") } err = future.WaitForCompletionRef(context.TODO(), vmClient.Client) if err != nil { ctx.Logger().Error(err) return errors.New("error waiting for vm deletion") } ctx.Logger().Log("Instance deleted") ctx.Logger().Log("Deleting resources related with instance") nicClient := a.getNicClient() for _, nicReference := range *vm.NetworkProfile.NetworkInterfaces { nicID := getAzureResourceNameFromID(*nicReference.ID) nic, err := nicClient.Get(context.TODO(), a.groupName, nicID, "") if err != nil { ctx.Logger().Error(err) return errors.New("failed getting nic") } if hasAzureOpsTags(nic.Tags) { err = a.DeleteNIC(ctx, &nic) if err != nil { ctx.Logger().Warn(err.Error()) } for _, ipConfiguration := range *nic.IPConfigurations { err := a.DeleteIP(ctx, &ipConfiguration) if err != nil { ctx.Logger().Warn(err.Error()) } } if nic.NetworkSecurityGroup != nil { err = a.DeleteNetworkSecurityGroup(ctx, *nic.NetworkSecurityGroup.ID) if err != nil { ctx.Logger().Warn(err.Error()) } } } } ctx.Logger().Log("Instance deletion completed") return nil }
/** * Deletes all dependent column placements * * @param adapterId The id of the adapter * @param columnId The id of the column */ @Override public void deleteColumnPlacement( int adapterId, long columnId ) { boolean lastPlacementOnStore = false; CatalogTable oldTable = getTable( getColumn( columnId ).tableId ); Map<Integer, ImmutableList<Long>> placementsByStore = new HashMap<>( oldTable.placementsByAdapter ); List<Long> placements = new ArrayList<>( placementsByStore.get( adapterId ) ); placements.remove( columnId ); if ( placements.size() != 0 ) { placementsByStore.put( adapterId, ImmutableList.copyOf( placements ) ); } else { placementsByStore.remove( adapterId ); lastPlacementOnStore = true; } CatalogTable table; synchronized ( this ) { if ( oldTable.isPartitioned ) { if ( log.isDebugEnabled() ) { log.debug( "Is flagged for deletion {}", isTableFlaggedForDeletion( oldTable.id ) ); } if ( !isTableFlaggedForDeletion( oldTable.id ) ) { if ( !validatePartitionGroupDistribution( adapterId, oldTable.id, columnId, 1 ) ) { throw new RuntimeException( "Partition Distribution failed" ); } } if ( log.isDebugEnabled() ) { log.debug( "Table '{}' is partitioned.", oldTable.name ); } table = new CatalogTable( oldTable.id, oldTable.name, oldTable.columnIds, oldTable.schemaId, oldTable.databaseId, oldTable.ownerId, oldTable.ownerName, oldTable.tableType, oldTable.primaryKey, ImmutableMap.copyOf( placementsByStore ), oldTable.modifiable, oldTable.partitionType, oldTable.partitionColumnId, oldTable.partitionProperty, oldTable.connectedViews ); if ( lastPlacementOnStore ) { dataPartitionGroupPlacement.remove( new Object[]{ adapterId, oldTable.id } ); if ( log.isDebugEnabled() ) { log.debug( "Column '{}' was the last placement on store: '{}.{}' ", getColumn( columnId ).name, getAdapter( adapterId ).uniqueName, table.name ); } } } else { table = new CatalogTable( oldTable.id, oldTable.name, oldTable.columnIds, oldTable.schemaId, oldTable.databaseId, oldTable.ownerId, oldTable.ownerName, oldTable.tableType, oldTable.primaryKey, ImmutableMap.copyOf( placementsByStore ), oldTable.modifiable, oldTable.partitionProperty, oldTable.connectedViews ); } tables.replace( table.id, table ); tableNames.replace( new Object[]{ table.databaseId, table.schemaId, table.name }, table ); columnPlacements.remove( new Object[]{ adapterId, columnId } ); } listeners.firePropertyChange( "columnPlacement", table, null ); }
export interface IFriends { friends: IFriend[]; } export interface IFriend { name: string; timeStamp: string; } export const RESULT_NOTE_MESSAGE = 'The result of comparison two uploaded files does not take into account changed person name or surname!';
Pyotr Pavlovich Kitkin Tsarist naval officer In 1896 Kitkin graduated from the Naval Cadet Corps, and on 25 September 1896, was promoted to midshipman with the appointment to the Black Sea Fleet and was enlisted in the 29th naval crew. Between 1896 and 1899 he served on the battleships Chesma and Georgii Pobedonosets, the cruiser Pamiat Merkuria, the minesweeper Ingul and the training ship Berezan. In 1899 he was a flag officer on the flagship of the Black Sea Fleet's practical squadron. In September 1899, he attended the a mine officer classes, and on 7 September 1900 was appointed a mine officer of the 2nd rank. Between 1900 and 1901 he served as a mine officer aboard the gunboat Uralets. Promoted to lieutenant in January 1901, he served that year as a watch officer on the Berezan. In October 1901 Kitkin was appointed to serve with the Pacific Squadron, and in February 1902 he was appointed a junior mine officer of the 1st rank cruiser Gromoboi. From June 1903 he was junior mine officer of the cruiser Rurik. In September 1903 he was appointed senior mine officer of the cruiser Askold, and he served aboard her during the Russo-Japanese War and the Siege of Port Arthur. In March 1904 he was appointed a mine officer of the 1st rank. After the battle of the Yellow Sea on 28 July 1904, the Askold, with Kitkin aboard, escaped to Shanghai and was interned there. After the war Kitkin went to serve with the Black Sea Fleet once more. In June 1906 Kitkin served as mine officer of the minesweeper Dunai, and from May 1906 he was the senior mine officer of the battleship Georgii Pobedonosets. In February 1907 he was transferred to the Baltic Fleet and enlisted in the 8th naval crew. Promoted to senior lieutenant in June 1907, he served as mine officer of the destroyer Lyogkii from September 1907. In January 1908 he was seconded to the Naval Technical Committee for training, and from June 1908 commanded the torpedo boat Prozorlivy. In November 1908 he was appointed mine officer of the flagship of the commander of the destroyer division, which on 12 March 1909 became the 2nd mine division of the Baltic Sea. From December 1908 he held the rank of First lieutenant. From October 1909 to July 1910 he was senior officer of the gunboat Khivinets, and from 1910 specialised in minesweeping. Promoted to captain 2nd rank in April 1911, he was appointed chief of the Baltic minesweeping division on 15 January 1912. In November 1913 he commanded the lead ship of the division, the gunboat Grozyashchii. In September 1914, with the outbreak of the First World War, Kitkin was promoted to Captain 1st rank for courageously resisting the enemy. In December 1914, he left the post of commander of the minesweepers, and in May 1915, he was appointed acting commander of the Baltic minesweeping division, before being confirmed in this post. In July 1917 he was promoted to rear admiral. Soviet service After 1918 Kitkin served in the Soviet Navy (RKKF). From 1918 to 1919 he was head of minesweeping, and from 1919 to 1920 the chief of the Baltic mine defences. In 1921 he was arrested by the Petrograd Special Department of the GPU, but was soon released. From 1921 to 1923 he was chairman of the Scientific and Technical Commission of Mine-Trial Experiments, and from 1923 to 1924 the chairman of the mine section of the NTK. From 1924 to 1926 he was the head of the mine testing site. From 1926 to 1931 he was Chairman of the Commission for Marine Mine Experiments. Simultaneously, from 1922-1941, he was teaching at the Naval Academy. In February 1931, he enlisted in the RKKF reserve, and in February 1936 he was dismissed to the reserve. In May 1942, he was appointed captain 1st rank, and from 1942 to 1943 commanded the Svir. In 1943 and 1944, Kitkin served as a specialist on naval mines for the Military Council of the Baltic Fleet, and from October 1944, was senior engineer-designer of the technical department of the NIMTI Navy. On 27 October 1944, by order of the People's Commissariat of the Navy, his period of freelance hire service, from 1936 to 1942, was counted as active service in the Navy. On 5 November 1944 he was promoted to rear admiral, and in January 1947, he was appointed head of the gunnery training department. In 1946, for his inventions in the field of mine warfare, the VAK approved the award of the degree of Doctor of Technical Sciences. In May 1948 he retired. He died in Leningrad on 18 September 1954, and was buried on the Literary Bridge of the Volkovo Cemetery. Scientific activity During his service in the Navy, many of Kitkin's inventions in the field of mines and trawls were adopted for service: mines arr. 1906, 1908, 1912, a cutter trawl (1913), a cartridge with two drums for the trawler boat (1920), a mine protector and a special purpose subversive cartridge (1928), a device known as a snake trawl (1929) a milestone (1929), special sweeping units for convoys (1936), and a device for the self-explosion of mines (1942). Ship After Admiral Kitkin's death, a Soviet ship was named in his honour.
A 19-year-old man was killed and a 51-year-old man wounded during separate shootings in the West Englewood neighborhood Wednesday, Jan. 21, 2015, police said. A 19-year-old man was killed and a 51-year-old man wounded in separate shootings in the West Englewood neighborhood Wednesday morning, police said. Officers responded to a call of shots fired about 9 a.m. in the 6600 block of South Oakley Avenue and found the 19-year-old, who was pronounced dead on the scene, said Chicago police spokesman Officer Jose Estrada. The man was identified as Edwin Cook, 19, of the 6600 block of South Bell Avenue--one block east of where Cook was killed--according to the Cook County medical examiner's office. He was pronounced dead at 9:25 a.m., according to the office. “He was on the sidewalk when a black four-door vehicle pulled up alongside him and an unknown armed offender opened fire on the victim,’’ Estrada said. The man was struck numerous times about the body, Estrada said. No one is in custody. Area Central detectives are investigating the homicide. At about 8:20 a.m., a 51-year-old man was shot in the right leg in the 6800 block of South Paulina Street, said police spokeswoman Ana Pacheco. He was taken to Advocate Christ Medical Center in Oak Lawn in good condition, Pacheco said. Area South detectives are investigating. In the aftermath of a fatal shooting in the 6600 block of South Oakley Avenue on Jan. 21, 2015, residents seek answers and information from Chicago police. Chicago police investigate a fatal shooting in the gangway of a home in the 6600 block of South Oakley Avenue in Chicago on Jan. 21, 2015.
The Boston Bruins' first appearance in the Stanley Cup Playoffs in three years, along with what is believed to be a strong run of drafting, has allowed them to exhibit more patience this offseason. The Bruins made splashes in free agency in each of the past two seasons but remained relatively quiet this year. They believe many of their prospects are NHL-ready and can be mentored by homegrown veterans and experienced players who were brought in during the first two years of Don Sweeney's tenure as general manager. Boston qualified for the 2017 playoffs, where it lost to the Ottawa Senators in six games in the Eastern Conference First Round. Injuries to several players, including four regular defensemen, derailed the regular season, when the Bruins finish third in the Atlantic Division, three points behind the Senators. [BRUINS 31 IN 31: Top prospects | 3 Questions | Fantasy breakdown | Behind the numbers] The only acquisitions from outside the organization were free agent defenseman Paul Postma and forward Kenny Agostino. But the Bruins aren't content with reaching the postseason and lasting two weeks, nor are they being shy with their resources. They simply believe some of their prospects are ready to blossom and compete for lineup spots in the NHL. "We've been fairly committed to allowing our young prospects to try and grow and take some opportunity," said Sweeney, who helped add free agent forward Matt Beleskey in 2015 and forward David Backes in 2016. "Now we've got competition, internal competition, set up. I do believe there will be a couple players ... that will challenge, particularly up front. "On the back end, probably not as much, which has led me to continue to look outside. ... But I think the most exciting part is the internal competition piece that we've set a plan in motion, and I think there are players that will step forward and grab the opportunity." Although the Bruins continue to work on a contract for restricted free agent forward David Pastrnak, who was second behind Brad Marchand in goals (39-34) and points (85-70) last season, they agreed to terms with every other restricted free agent they qualified. That includes center Ryan Spooner, who had 39 points (11 goals, 28 assists) last season. The Bruins hope he will solidify their third-line center position. Video: 31 in 31: Boston Bruins 2017-18 season preview The Bruins also lured Anders Bjork from Notre Dame after the speedy wing's junior season. Bjork, a fifth-round pick (No. 146) in the 2014 NHL Draft, had 52 points (21 goals, 31 assists) last season and will be one of the primary young players fighting for a roster spot in training camp. They include forwards Danton Heinen and Peter Cehlarik, who each played in the NHL last season; Jake DeBrusk and Zach Senyshyn, two of the Bruins' three 2015 first-round picks who are close to making their NHL debut; and center Jakob Forsbacka Karlsson, who played one NHL game after leaving Boston University following his junior season Mixing in so much youth could put the onus on veterans Patrice Bergeron, Marchand, Krejci and Backes to have patience and be mentors. Bruce Cassidy, who became Bruins coach on Feb. 7, said he believes they can benefit from the youth-veteran mix the way the Pittsburgh Penguins have with Conor Sheary and Jake Guentzel mixing in with Sidney Crosby, Evgeni Malkin and others. "I have to convince those guys that they have to pull this kid along, whatever kid it happens to be, because that will make us a better team if we can spread the wealth and use other players in different roles," Cassidy said. "That's the challenge. I think that will be our biggest challenge, and one I'm looking forward to because I do believe some of these young kids, assuming they're ready ... that could make us a much better, stronger team if we incorporate those younger guys." There are fewer young defensemen ready, but their talent level might exceed that of the forwards. Charlie McAvoy made an impressive NHL debut in the six playoff games, and the Bruins already have him penciled into their top four. They already know what it's like to have a rookie in their top four after Brandon Carlo played 82 games last season next to No. 1 defenseman Zdeno Chara before an injury kept him out of the playoffs. The Bruins basically know what they're going to get from Bergeron and Marchand up front, and Chara and Torey Krug on defense. Barring a major trade or change in direction from the organization, it'll be up to their younger players to take the next step in their career if they hope to take another step in the playoffs.
<reponame>Flytte/flytte #include "controller/Drone.hpp" #include <iostream> Drone::Drone(std::string name, double posX, double posY, double w, double h, double rotX, double rotY, double rotZ) : m_name(name), m_current(new BBox(posX, posY, w, h, rotX, rotY, rotZ)), m_last(nullptr), m_target(nullptr) {} Drone::Drone(std::string name, BBox box) : m_name(name), m_current(new BBox(box)), m_last(nullptr), m_target(nullptr) {} Drone::Drone(const Drone& other) : m_name(other.name()), m_current(new BBox(other.current().first)), m_last(nullptr), m_target(nullptr) { if(other.last().second) { this->m_last = new BBox(other.last().first); } if(other.target().second) { this->m_target = new BBox(other.target().first); } } Drone& Drone::operator=(const Drone& other) { m_name = other.name(); *m_current = other.current().first; if(other.last().second) { if(!this->m_last) { this->m_last = new BBox; } *(this->m_last) = BBox(other.last().first); } else { if(this->m_last) { delete this->m_last; this->m_last = nullptr; } } if(other.target().second) { if(!this->m_target) { this->m_target = new BBox; } *(this->m_target) = BBox(other.target().first); } else { if(this->m_target) { delete this->m_target; this->m_target = nullptr; } } return *this; } std::pair<BBox, bool> Drone::current() const { return std::make_pair(*m_current, true); } std::pair<BBox, bool> Drone::last() const { if(!m_last) { return std::make_pair(BBox(), false); } return std::make_pair(*m_last, true); } std::pair<BBox, bool> Drone::target() const { if(!m_target) { return std::make_pair(BBox(), false); } return std::make_pair(*m_target, true); } std::pair<BBox, bool> Drone::getBBox(Drone::BBoxKind id) const { if(id == Drone::BBoxKind::LAST) { return this->last(); } else if(id == Drone::BBoxKind::TARGET) { return this->target(); } else { return this->current(); } } void Drone::setCurrent(BBox box) { if(!m_last) { m_last = new BBox(); } *m_last = *m_current; *m_current = box; } void Drone::setTarget(BBox box) { if(!m_target) { m_target = new BBox(); } *m_target = box; } void Drone::clearTarget() { if(m_target != nullptr) { delete m_target; m_target = nullptr; } } Drone::~Drone() { delete this->m_current; if(!this->m_last) { delete this->m_last; this->m_last = nullptr; } if(!this->m_target) { delete this->m_target; this->m_target = nullptr; } }
package com.gxitsky.creational.builder.familybarrel; public class Director { public void construct(Builder builder) { builder.buildCocaCola(); builder.buildDrumstick(); builder.buildFrenchFires(); builder.buildHamburger(); builder.buildPie(); } }
<reponame>erexer/polyaxon #!/usr/bin/python # # Copyright 2018-2020 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import subprocess import sys import click from polyaxon.cli.errors import handle_cli_error from polyaxon.deploy.operators.conda import CondaOperator from polyaxon.exceptions import ( PolyaxonClientException, PolyaxonException, PolyaxonHTTPError, PolyaxonShouldExitError, ) from polyaxon.utils.formatting import Printer from polyaxon.utils.hashing import hash_value def _get_conda_env_name(conda_env): conda_env_contents = open(conda_env).read() if conda_env else "" conda_tag = hash_value(conda_env_contents) return "polyaxon-{}".format(conda_tag) def _run( ctx, name, owner, project_name, description, tags, specification, log, conda_env ): conda = CondaOperator() # cmd = CmdOperator() if not conda.check(): raise PolyaxonException("Conda is required to run this command.") envs = conda.execute(["env", "list", "--json"], is_json=True) env_names = [os.path.basename(env) for env in envs["envs"]] project_env_name = _get_conda_env_name(conda_env) if project_env_name not in env_names: click.echo("Creating conda environment {}".format(project_env_name)) conda.execute( ["env", "create", "-n", project_env_name, "--file", conda_env], stream=True ) cmd_bash, cmd_args = specification.run.get_container_cmd() cmd_args = ["source activate {}".format(project_env_name)] + cmd_args subprocess.Popen(cmd_bash + [" && ".join(cmd_args)], close_fds=True) def run( ctx, name, owner, project_name, description, tags, specification, log, conda_env ): try: _run( ctx, name, owner, project_name, description, tags, specification, log, conda_env, ) except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e: handle_cli_error(e, message="Could start local run.") sys.exit(1) except Exception as e: Printer.print_error("Could start local run.") Printer.print_error("Unexpected Error: `{}`.".format(e)) sys.exit(1)
<reponame>josecleiton/sdkgen import classnames from "classnames"; import * as React from "react"; import s from "./section.scss"; interface TitleProps { title: string; featured?: boolean; } export function Section(props: React.PropsWithChildren<TitleProps>): JSX.Element { const { title, featured, children } = props; return ( <div className={classnames(s.section, featured && s.featured)}> <div className={s.title}>{title}</div> <div className={s.childrenWrapper}>{children}</div> </div> ); }
Ron Paul introduced a bill that would require the Fed to manually audit every U.S.-owned gold bar. WASHINGTON (CNNMoney) -- With the price of gold at record highs, presidential candidate Rep. Ron Paul wants to make sure the U.S. gold bars at Fort Knox are really there. Paul called a congressional hearing Thursday to grill federal officials about his bill to audit and inventory all of the gold reserves at Fort Knox, Ky., West Point, N.Y., and Denver, even though Treasury officials insist that the gold is audited annually and is all there. During the hearing, Paul suggested that the Federal Reserve of New York, which has 5% of the U.S. gold reserves, has the ability to secretly sell or swap gold with other countries without anyone knowing. "The Fed is pretty secret, you know," said Paul, who leans Libertarian. "Congress doesn't have much say on what's going on over there. They do a lot of hiding." Paul, a Texas Republican who wants to convert the U.S. monetary system to one based on the gold standard, says the federal government owes it to taxpayers to make sure U.S.-owned gold is safe. (Ron Paul: Bernanke's biggest critic) "This is one of the few legitimate functions of government: To check our ownership and be fiscally responsible and find out just what we own and whether it's really there," said Paul, who is among those running for the Republican presidential nomination. Audits by the Treasury Department and Government Accountability Office are based on samples. Paul wants to open up Fort Knox and other reserves and count the bars manually. "We know where it is. We know how much there is. We know it's there. None of it has been removed," said Treasury Inspector General Eric Thorson. In September, Treasury completed its latest audit, showing that U.S. gold reserves total 9,300 tons with a market value of $320 billion, Thorson said. The recent run-up in gold prices -- the precious metal is trading at about $1,515 an ounce -- puts the market value at $340 billion as of Wednesday, according to Thorson's testimony. He added that each gold bar weighs about 27 pounds and is worth around $500,000. Paul said that his questions were partly in response to the numerous Internet conspiracy theories, including those that accuse the government of secretly selling all of the gold in Fort Knox. Thorson said Treasury doesn't believe that anyone, including the Fed, has taken the gold or laid claim to U.S. gold bars. Any further audit as proposed by Paul's legislation would be redundant, he said. "There is no movement. There is nothing there that can happen, once those doors are sealed," Thorson said. "It's very obvious if those seals are ever broken." William Lacy Clay, a Democratic representative from Missouri, said that doing a complete audit as Paul is calling for is a waste of federal manpower and could cost tens of millions of taxpayer dollars. Thorson reported that the U.S. Mint told him that moving, counting and testing the gold would cost around $60 million. Paul said he had heard from Treasury that it would only cost $15 million. Part of the expense would be due to the bill's requirement to "assay" all the gold, said Gary T. Engel, a director of Financial Management and Assurance at GAO. Assaying means drilling little holes in all the gold bars in order to test its purity. But that process is "basically destroying whatever that piece is." Finally, Engel cautioned, "There will be some loss of the gold from the bars through the assaying process if you do that for every single bar that's out there."
Building Collaborative Partnerships in Critical Care: The RN Case Manager/Social Work Dyad in Critical Care Purpose/Objectives More than 5 million patients are admitted annually to intensive care units (ICUs) in the United States. As the life expectancy of the population continues to lengthen, we should expect to see a proportionate increase in the burden of acute and chronic illness as well as a rise in the demand for critical care services. The case management dyad team of nurse case manager and social worker enhances and supports the critical care team through the implementation of collaborative interventions that focus upon the minimization of inpatient transitions, reduction of cost by decreasing the length of stay, promotion of patient and family satisfaction through efforts of advocacy, and enhanced discharge planning. Primary Practice Setting(s) Hospital ICUs. Findings/Conclusions In the critical care setting the professional partnership of the RN case manager/masters in social worker (RN/MSW) dyad is a core component in the linkage of the ICU support system and it enhances the functioning of the ICU multidisciplinary team. The efforts of the dyad team are congruent with the goals of patient care, with the desires of the family, and with the mission of the organization. Shared goals and a shared commitment to professional practice provide the essential building blocks of the dyad relationship. The dyad structure presents an opportunity for RN case managers and social workers to integrate their strengths and skills in a collaborative patient-centered effort. Implications for Case Management PracticeThe RN/MSW dyad structure as a model for case management practice promotes continuity of care and strengthens professional relationships. The case manager and the social worker have many shared responsibilities; therefore, a partnership that promotes continuous collaboration and communication is essential to the achievement of successful patient care outcomes.The professional partnership that evolves, as depicted by the RN/MSW dyad structure, enhances the organizations' mission to deliver quality patient-centered care.
Load frequency control of a nonlinear two-area power system In an interconnected power system, all the generators must run at an appropriate capacity to meet the demand in power. Loss of synchronism between the generators and/or too much frequency fluctuations may cause protective equipment to trip. Load frequency control (LFC) is necessary to balance the power generation and the load, by monitoring frequency and power changes between interconnected power systems in tie-lines. In this paper, power systems from previous research works are analysed for stability, and different types of controllers are designed and validated through simulation and compared with a Proportional-Integral-Derivative (PID) - controlled power system. Three types of controllers are considered, namely Fuzzy, Fuzzy-PID and Adaptive NeuroFuzzy controllers. The first power system considered is a linear identical non-reheat two-area system. However, a linear system does not model an actual power system completely because of neglected nonlinearities. Hence, two main sources of nonlinearity (generation rate constraint (GRC) and governor dead band (GDB)), which arise due to practical constraints are considered and included in the model of the system.
Mirta N. S. Bugarin, Joint with Roberto De Goes Ellery Human Capital and Income Concentration High income concentration and poverty in Brazil have been intensively studied by Paes de Barro, Henriques and Mendon ca (2000 a and b). In their words, "...Brazil is not a poor country, but a country with too much poor people...". their careful research shows clearly that the high poverty is due mainly to the high concentration of income and to the "unequal opportunities for social and economic inclusion". Although international comparisons shows that almost 70% of the countries have a per capita aincome below Brazil's. steadily during 1978 to 1998, as much as 10% of the reachest families in the country have access to 50% of the aggregate family income whereas 50% of the poorest households have a participation of only 10% over the same aggregate income. An obvious factor in uencing unequal earnings is the heterogeneous level of education among the labor force, for education can be understood as a mean to attain improvements in labor productivity, consequently in family income. Based on the above arguments, the present study aims to construct a recursive general equilibrium model where a "poverty trap" can be genereted. The agents of the model economy are heterogeneous for they di er in the level of education, and according to this di erential they face di erent employment opportunities which evolves according to a stochastic process descrived by a two state Markov chain. The associated transition probability matrixes re ect the fact that more educated agents face a higher probability to remain employed next period if they are currently employed and, if they are actually unemployed they also have a higher probability of been employed next period. The steady state analysis shows that this model economy can generate a high concentration of income as suggested by the Brazilian empirical evidence. The authors would like to thank F abio Kanczuk and Maur cio Bugarin for helpful comments. None of the above is responsible for errors or opinions expressed.
Opto-Electrical Characterization of Annealed Cdse And Cdte Thin Films Synthesized Via Thermal Evaporation Technique This study reports the synthesis and characterization of CdSe and CdTe multilayer thin films via Thermal evaporation technique. The multilayer thin films were respectively prepared sequentially at 100 C in a vacuum of about 2.0 x 10 torr and annealed in vacuum at 120 C for 15 mins. The thickness of Cd was 500 while Se and Te were respectively 150. Optical properties were studied using UVVis Spectrophotometer. The electrical characterization was carried out using Keithley Four-point Probe. UV-Visible analysis of the film showed a direct optical band gap which is found to be 1.90 eV and 1.00 eV for the CdSe and CdTe films respectively, with an enhanced light absorption in the range of 350 nm to 950 nm (at infra-red region) spectrum. The Electrical results revealed that the CdSe exhibited n-type semi-conductivity because of non-stoichiometry with optimum resistivity of 0.86 x 10 cm while CdTe exhibited a p-type semi-conductivity. It could be concluded that CdSe is a good material for window layer while CdTe is a good material for absorber in photovoltaic applications.
// SetReadPos sets the read position of the view's internal buffer. // So the next Read call would read from the specified position. func (v *View) SetReadPos(x, y int) error { if x < 0 || y < 0 { return ErrInvalidPoint } v.readBuffer = nil v.rx = x v.ry = y return nil }
ISLAMABAD, Oct 19 (APP):Pakistan and the United Arab Emirates (UAE) have agreed to evolve an effective strategy for extradition of Pakistanis detained in the UAE for committing petty crimes. An agreement to that this effect was reached during a meeting held the other day between UAE Ambassador Hamad Obaid Ibrahim Salem Al Zaabi and Special Assistant to the Prime Minister(SAPM) on Overseas Pakistanis Zulfikar Bukhari here, said a Spokesperson of Ministry of Overseas Pakistani and Human Resource Development. The two sides discussed plight of Pakistani workers imprisoned in the UAE for minor crimes and considered ways and means to mitigate their sufferings. They also deliberated on the matters of bilateral interests and stressed the need for further cementing the existing ties between the two countries. Their discussion focused on how to improve the working conditions for the blue-collar Pakistani workers across the UAE and they agreed to increase opportunities for the Pakistani manpower there. The ambassador expressed his commitment towards improving the visa process by establishing a specialized visa desk at a the UAE consulates operating in Pakistan. They underlined the need for better coordination among relevant departments of both the countries to forge closer ties as it would eventually enhance the export of skilled labour for future projects across the UAE as an investment in human’s capital of Pakistan.
import pandas as pd from snakemake import shell fastq1 = snakemake.input.r1 fastq2 = snakemake.input.r2 oname1 = snakemake.output.r1 oname2 = snakemake.output.r2 sampletable = pd.read_csv(snakemake.config['sampletable'], sep='\t', index_col=0) extra = snakemake.params.extra log = snakemake.log def main(): layout = get_layout() if layout == 'PE': shell( "cutadapt " "{extra} " "{fastq1} " "{fastq2} " "-o {oname1} " "-p {oname2} " "&> {log}" ) else: shell( "cutadapt " "{extra} " "{fastq1} " "-o {oname1} " "&> {log} " "&& touch {oname2}" ) def get_layout(): srx = snakemake.wildcards.sample layout = sampletable.loc[srx, 'layout'] if isinstance(layout, str): return layout return layout.tolist()[0] if __name__ == '__main__': main()
<reponame>sandyrides/s2n-tls<filename>tests/unit/s2n_early_data_io_api_test.c /* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include "s2n_test.h" #include "testlib/s2n_testlib.h" #include "tls/s2n_early_data.h" #define BUFFER_SIZE 100 #define EXPECT_NOT_BLOCKED(conn, blocked, expected_msg) \ EXPECT_EQUAL((blocked), S2N_NOT_BLOCKED); \ EXPECT_EQUAL(s2n_conn_get_current_message_type(conn), (expected_msg)) #define EXPECT_BLOCKED_ON_EARLY_DATA(result) EXPECT_FAILURE_WITH_ERRNO((result), S2N_ERR_EARLY_DATA_BLOCKED) #define EXPECT_BLOCKED_ON_IO(result) EXPECT_FAILURE_WITH_ERRNO((result), S2N_ERR_IO_BLOCKED) #define EXPECT_BLOCKED_ON(conn, blocked, expected_blocked, expected_msg) \ EXPECT_EQUAL((blocked), (expected_blocked)); \ EXPECT_EQUAL(s2n_conn_get_current_message_type(conn), (expected_msg)) static S2N_RESULT s2n_test_client_and_server_new(struct s2n_connection **client_conn, struct s2n_connection **server_conn) { *client_conn = s2n_connection_new(S2N_CLIENT); EXPECT_NOT_NULL(*client_conn); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(*client_conn, "default_tls13")); *server_conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(*server_conn); EXPECT_SUCCESS(s2n_connection_set_blinding(*server_conn, S2N_SELF_SERVICE_BLINDING)); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(*server_conn, "default_tls13")); struct s2n_test_io_pair io_pair = { 0 }; EXPECT_SUCCESS(s2n_io_pair_init_non_blocking(&io_pair)); EXPECT_SUCCESS(s2n_connections_set_io_pair(*client_conn, *server_conn, &io_pair)); return S2N_RESULT_OK; } uint8_t s2n_allowed_reads = 0; static int s2n_blocking_buffer_read(void *io_context, uint8_t *buf, uint32_t len) { struct s2n_stuffer *in = (struct s2n_stuffer *) io_context; bool would_block = s2n_stuffer_data_available(in) < len; if (would_block || !s2n_allowed_reads) { errno = EAGAIN; return -1; } s2n_allowed_reads--; POSIX_GUARD(s2n_stuffer_read_bytes(in, buf, len)); return len; } uint8_t s2n_allowed_writes = 0; static int s2n_blocking_buffer_write(void *io_context, const uint8_t *buf, uint32_t len) { struct s2n_stuffer *out = (struct s2n_stuffer *) io_context; bool would_block = !out->growable && s2n_stuffer_space_remaining(out) < len; if (would_block || !s2n_allowed_writes) { errno = EAGAIN; return -1; } s2n_allowed_writes--; POSIX_GUARD(s2n_stuffer_write_bytes(out, buf, len)); return len; } int main(int argc, char **argv) { BEGIN_TEST(); const uint8_t test_data[] = "hello world"; /* Malformed record: empty handshake record */ uint8_t malformed_record[] = { TLS_HANDSHAKE, 0x03, 0x03, 0x00, 0x04, TLS_FINISHED, 0x00, 0x00, 0x00 }; DEFER_CLEANUP(struct s2n_psk *test_psk = s2n_external_psk_new(), s2n_psk_free); EXPECT_SUCCESS(s2n_psk_set_identity(test_psk, test_data, sizeof(test_data))); EXPECT_SUCCESS(s2n_psk_set_secret(test_psk, test_data, sizeof(test_data))); EXPECT_SUCCESS(s2n_psk_configure_early_data(test_psk, UINT32_MAX, 0x13, 0x01)); DEFER_CLEANUP(struct s2n_psk *test_psk_without_early_data = s2n_external_psk_new(), s2n_psk_free); EXPECT_SUCCESS(s2n_psk_set_identity(test_psk_without_early_data, test_data, sizeof(test_data))); EXPECT_SUCCESS(s2n_psk_set_secret(test_psk_without_early_data, test_data, sizeof(test_data))); DEFER_CLEANUP(struct s2n_psk *test_psk_with_wrong_early_data = s2n_external_psk_new(), s2n_psk_free); EXPECT_SUCCESS(s2n_psk_set_identity(test_psk_with_wrong_early_data, test_data, sizeof(test_data))); EXPECT_SUCCESS(s2n_psk_set_secret(test_psk_with_wrong_early_data, test_data, sizeof(test_data))); EXPECT_SUCCESS(s2n_psk_configure_early_data(test_psk_with_wrong_early_data, UINT32_MAX, 0x13, 0x03)); EXPECT_SUCCESS(s2n_psk_set_application_protocol(test_psk_with_wrong_early_data, test_data, sizeof(test_data))); /* Test s2n_send_early_data */ { /* Safety checks */ { struct s2n_connection conn = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; uint8_t data = 0; EXPECT_FAILURE_WITH_ERRNO(s2n_send_early_data(NULL, &data, 1, &data_size, &blocked), S2N_ERR_NULL); EXPECT_FAILURE_WITH_ERRNO(s2n_send_early_data(&conn, &data, 1, NULL, &blocked), S2N_ERR_NULL); EXPECT_FAILURE_WITH_ERRNO(s2n_send_early_data(&conn, &data, 1, &data_size, NULL), S2N_ERR_NULL); conn.mode = S2N_SERVER; EXPECT_FAILURE_WITH_ERRNO(s2n_send_early_data(&conn, &data, 1, &data_size, &blocked), S2N_ERR_SERVER_MODE); } /* Propagate errors from s2n_negotiate */ { struct s2n_connection *client_conn = s2n_connection_new(S2N_CLIENT); EXPECT_NOT_NULL(client_conn); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(client_conn, "default_tls13")); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk)); DEFER_CLEANUP(struct s2n_stuffer input = { 0 }, s2n_stuffer_free); DEFER_CLEANUP(struct s2n_stuffer output = { 0 }, s2n_stuffer_free); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&input, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&output, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_connection_set_io_stuffers(&input, &output, client_conn)); EXPECT_SUCCESS(s2n_stuffer_write_bytes(&input, malformed_record, sizeof(malformed_record))); s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; EXPECT_FAILURE_WITH_ERRNO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked), S2N_ERR_BAD_MESSAGE); EXPECT_EQUAL(s2n_conn_get_current_message_type(client_conn), SERVER_HELLO); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_stuffer_free(&input)); EXPECT_SUCCESS(s2n_stuffer_free(&output)); EXPECT_SUCCESS(s2n_connection_free(client_conn)); } /* Propagate errors from s2n_send */ { struct s2n_connection *client_conn = s2n_connection_new(S2N_CLIENT); EXPECT_NOT_NULL(client_conn); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(client_conn, "default_tls13")); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk)); DEFER_CLEANUP(struct s2n_stuffer input = { 0 }, s2n_stuffer_free); DEFER_CLEANUP(struct s2n_stuffer output = { 0 }, s2n_stuffer_free); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&output, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_connection_set_io_stuffers(&input, &output, client_conn)); /* Indicate that we're already sending. That will cause an error. */ client_conn->send_in_use = true; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; EXPECT_FAILURE_WITH_ERRNO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked), S2N_ERR_REENTRANCY); EXPECT_EQUAL(s2n_conn_get_current_message_type(client_conn), SERVER_HELLO); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_stuffer_free(&output)); EXPECT_SUCCESS(s2n_connection_free(client_conn)); } } /* s2n_recv_early_data */ { /* Safety checks */ { struct s2n_connection conn = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; uint8_t data = 0; EXPECT_FAILURE_WITH_ERRNO(s2n_recv_early_data(NULL, &data, 1, &data_size, &blocked), S2N_ERR_NULL); EXPECT_FAILURE_WITH_ERRNO(s2n_recv_early_data(&conn, &data, 1, NULL, &blocked), S2N_ERR_NULL); EXPECT_FAILURE_WITH_ERRNO(s2n_recv_early_data(&conn, &data, 1, &data_size, NULL), S2N_ERR_NULL); conn.mode = S2N_CLIENT; EXPECT_FAILURE_WITH_ERRNO(s2n_recv_early_data(&conn, &data, 1, &data_size, &blocked), S2N_ERR_CLIENT_MODE); } /* Propagate errors from s2n_negotiate */ { struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(server_conn); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "default_tls13")); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, test_psk)); DEFER_CLEANUP(struct s2n_stuffer input = { 0 }, s2n_stuffer_free); DEFER_CLEANUP(struct s2n_stuffer output = { 0 }, s2n_stuffer_free); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&input, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_connection_set_io_stuffers(&input, &output, server_conn)); EXPECT_SUCCESS(s2n_stuffer_write_bytes(&input, malformed_record, sizeof(malformed_record))); uint8_t payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; EXPECT_FAILURE_WITH_ERRNO(s2n_recv_early_data(server_conn, payload, sizeof(payload), &data_size, &blocked), S2N_ERR_BAD_MESSAGE); EXPECT_EQUAL(s2n_conn_get_current_message_type(server_conn), CLIENT_HELLO); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_stuffer_free(&input)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Propagate errors from s2n_recv */ { struct s2n_connection *client_conn = NULL, *server_conn = NULL; EXPECT_OK(s2n_test_client_and_server_new(&client_conn, &server_conn)); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk)); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, test_psk)); /* Indicate that we're already receiving. That will cause an error. */ server_conn->recv_in_use = true; uint8_t payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_READ, SERVER_HELLO); EXPECT_FAILURE_WITH_ERRNO(s2n_recv_early_data(server_conn, payload, sizeof(payload), &data_size, &blocked), S2N_ERR_REENTRANCY); EXPECT_EQUAL(s2n_conn_get_current_message_type(server_conn), END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_connection_free(client_conn)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } } /* Test sending and receiving early data */ { /* Send zero-length early data */ { struct s2n_connection *client_conn = NULL, *server_conn = NULL; EXPECT_OK(s2n_test_client_and_server_new(&client_conn, &server_conn)); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk)); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, test_psk)); s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; s2n_early_data_status_t status = 0; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, NULL, 0, &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_READ, SERVER_HELLO); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_connection_get_early_data_status(client_conn, &status)); EXPECT_EQUAL(status, S2N_EARLY_DATA_STATUS_OK); EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, NULL, 0, &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_connection_get_early_data_status(server_conn, &status)); EXPECT_EQUAL(status, S2N_EARLY_DATA_STATUS_OK); EXPECT_SUCCESS(s2n_negotiate_test_server_and_client(server_conn, client_conn)); EXPECT_SUCCESS(s2n_connection_free(client_conn)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Send early data once */ { struct s2n_connection *client_conn = NULL, *server_conn = NULL; EXPECT_OK(s2n_test_client_and_server_new(&client_conn, &server_conn)); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk)); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, test_psk)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; s2n_early_data_status_t status = 0; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_READ, SERVER_HELLO); EXPECT_EQUAL(data_size, sizeof(test_data)); EXPECT_SUCCESS(s2n_connection_get_early_data_status(client_conn, &status)); EXPECT_EQUAL(status, S2N_EARLY_DATA_STATUS_OK); EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, sizeof(test_data)); EXPECT_BYTEARRAY_EQUAL(actual_payload, test_data, sizeof(test_data)); EXPECT_SUCCESS(s2n_connection_get_early_data_status(server_conn, &status)); EXPECT_EQUAL(status, S2N_EARLY_DATA_STATUS_OK); EXPECT_SUCCESS(s2n_negotiate_test_server_and_client(server_conn, client_conn)); EXPECT_SUCCESS(s2n_connection_free(client_conn)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Receive early data too large for buffer */ { struct s2n_connection *client_conn = NULL, *server_conn = NULL; EXPECT_OK(s2n_test_client_and_server_new(&client_conn, &server_conn)); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk)); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, test_psk)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_READ, SERVER_HELLO); EXPECT_EQUAL(data_size, sizeof(test_data)); EXPECT_BLOCKED_ON_EARLY_DATA(s2n_recv_early_data(server_conn, NULL, 0, &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_EARLY_DATA, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, 0); EXPECT_BLOCKED_ON_EARLY_DATA(s2n_recv_early_data(server_conn, actual_payload, 1, &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_EARLY_DATA, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, 1); EXPECT_BYTEARRAY_EQUAL(actual_payload, test_data, 1); /* Remaining early data should block handshake. * We can't successfully call s2n_negotiate again until we've drained all the early data * via s2n_recv_early_data. For safety, we are not allowed to arbitrarily discard any early data. */ EXPECT_FAILURE_WITH_ERRNO(s2n_negotiate_test_server_and_client(server_conn, client_conn), S2N_ERR_BAD_MESSAGE); EXPECT_SUCCESS(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_NOT_BLOCKED(server_conn, blocked, APPLICATION_DATA); EXPECT_EQUAL(data_size, sizeof(test_data) - 1); EXPECT_BYTEARRAY_EQUAL(actual_payload, test_data + 1, sizeof(test_data) - 1); EXPECT_SUCCESS(s2n_negotiate_test_server_and_client(server_conn, client_conn)); EXPECT_SUCCESS(s2n_connection_free(client_conn)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Send multiple early data messages */ { struct s2n_connection *client_conn = NULL, *server_conn = NULL; EXPECT_OK(s2n_test_client_and_server_new(&client_conn, &server_conn)); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk)); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, test_psk)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_READ, SERVER_HELLO); EXPECT_EQUAL(data_size, sizeof(test_data)); EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, sizeof(test_data)); EXPECT_BYTEARRAY_EQUAL(actual_payload, test_data, sizeof(test_data)); for (size_t i = 0; i < 10; i++) { EXPECT_SUCCESS(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_NOT_BLOCKED(client_conn, blocked, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, sizeof(test_data)); EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, sizeof(test_data)); EXPECT_BYTEARRAY_EQUAL(actual_payload, test_data, sizeof(test_data)); } EXPECT_SUCCESS(s2n_negotiate_test_server_and_client(server_conn, client_conn)); EXPECT_SUCCESS(s2n_connection_free(client_conn)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Receive and combine multiple early data records */ { struct s2n_connection *client_conn = NULL, *server_conn = NULL; EXPECT_OK(s2n_test_client_and_server_new(&client_conn, &server_conn)); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk)); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, test_psk)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; const size_t send_count = 5; for (size_t i = 0; i < send_count; i++) { EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_READ, SERVER_HELLO); EXPECT_EQUAL(data_size, sizeof(test_data)); } EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, sizeof(test_data) * send_count); struct s2n_blob payload_blob = { 0 }; struct s2n_stuffer payload_stuffer = { 0 }; EXPECT_SUCCESS(s2n_blob_init(&payload_blob, actual_payload, sizeof(actual_payload))); EXPECT_SUCCESS(s2n_stuffer_init(&payload_stuffer, &payload_blob)); EXPECT_SUCCESS(s2n_stuffer_skip_write(&payload_stuffer, data_size)); uint8_t payload_chunk[sizeof(test_data)] = { 0 }; for (size_t i = 0; i < send_count; i++) { EXPECT_SUCCESS(s2n_stuffer_read_bytes(&payload_stuffer, payload_chunk, sizeof(test_data))); EXPECT_BYTEARRAY_EQUAL(payload_chunk, test_data, sizeof(test_data)); } EXPECT_EQUAL(s2n_stuffer_data_available(&payload_stuffer), 0); EXPECT_SUCCESS(s2n_negotiate_test_server_and_client(server_conn, client_conn)); EXPECT_SUCCESS(s2n_connection_free(client_conn)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Early data not requested */ { struct s2n_connection *client_conn = NULL, *server_conn = NULL; EXPECT_OK(s2n_test_client_and_server_new(&client_conn, &server_conn)); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk_with_wrong_early_data)); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, test_psk)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; s2n_early_data_status_t status = 0; EXPECT_SUCCESS(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_NOT_BLOCKED(client_conn, blocked, SERVER_HELLO); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_connection_get_early_data_status(client_conn, &status)); EXPECT_EQUAL(status, S2N_EARLY_DATA_STATUS_NOT_REQUESTED); EXPECT_SUCCESS(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_NOT_BLOCKED(server_conn, blocked, CLIENT_FINISHED); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_connection_get_early_data_status(server_conn, &status)); EXPECT_EQUAL(status, S2N_EARLY_DATA_STATUS_NOT_REQUESTED); EXPECT_SUCCESS(s2n_negotiate_test_server_and_client(server_conn, client_conn)); EXPECT_SUCCESS(s2n_connection_free(client_conn)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Early data rejected */ { struct s2n_connection *client_conn = NULL, *server_conn = NULL; EXPECT_OK(s2n_test_client_and_server_new(&client_conn, &server_conn)); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk)); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, test_psk_with_wrong_early_data)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; s2n_early_data_status_t status = 0; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_READ, SERVER_HELLO); EXPECT_EQUAL(data_size, sizeof(test_data)); EXPECT_SUCCESS(s2n_connection_get_early_data_status(client_conn, &status)); EXPECT_EQUAL(status, S2N_EARLY_DATA_STATUS_OK); EXPECT_SUCCESS(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_NOT_BLOCKED(server_conn, blocked, CLIENT_FINISHED); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_connection_get_early_data_status(server_conn, &status)); EXPECT_EQUAL(status, S2N_EARLY_DATA_STATUS_REJECTED); EXPECT_SUCCESS(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_NOT_BLOCKED(client_conn, blocked, APPLICATION_DATA); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_connection_get_early_data_status(client_conn, &status)); EXPECT_EQUAL(status, S2N_EARLY_DATA_STATUS_REJECTED); EXPECT_SUCCESS(s2n_negotiate_test_server_and_client(server_conn, client_conn)); EXPECT_SUCCESS(s2n_connection_free(client_conn)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } } /* Test blocking behavior when sending and receiving early data. * * We override the send and recv callbacks to allow us to block on every * call to s2n_negotiate, s2n_send, and s2n_recv. This lets us exercise all * possible blocking paths. */ { /* To read a record, we need to both read its header and read its data */ const uint8_t full_record_reads = 2; struct s2n_connection *client_conn = s2n_connection_new(S2N_CLIENT); EXPECT_NOT_NULL(client_conn); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(client_conn, "default_tls13")); EXPECT_SUCCESS(s2n_connection_append_psk(client_conn, test_psk)); struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(server_conn); EXPECT_SUCCESS(s2n_connection_set_blinding(server_conn, S2N_SELF_SERVICE_BLINDING)); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "default_tls13")); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, test_psk)); DEFER_CLEANUP(struct s2n_stuffer client_in = { 0 }, s2n_stuffer_free); DEFER_CLEANUP(struct s2n_stuffer server_in = { 0 }, s2n_stuffer_free); EXPECT_SUCCESS(s2n_stuffer_alloc(&client_in, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_stuffer_alloc(&server_in, S2N_DEFAULT_RECORD_LENGTH)); POSIX_GUARD(s2n_connection_set_recv_cb(client_conn, &s2n_blocking_buffer_read)); POSIX_GUARD(s2n_connection_set_recv_ctx(client_conn, &client_in)); POSIX_GUARD(s2n_connection_set_recv_cb(server_conn, &s2n_blocking_buffer_read)); POSIX_GUARD(s2n_connection_set_recv_ctx(server_conn, &server_in)); POSIX_GUARD(s2n_connection_set_send_cb(client_conn, &s2n_blocking_buffer_write)); POSIX_GUARD(s2n_connection_set_send_ctx(client_conn, &server_in)); POSIX_GUARD(s2n_connection_set_send_cb(server_conn, &s2n_blocking_buffer_write)); POSIX_GUARD(s2n_connection_set_send_ctx(server_conn, &client_in)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_size = 0; /* Block writing the ClientHello */ s2n_allowed_writes = 0; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_WRITE, CLIENT_HELLO); EXPECT_EQUAL(data_size, 0); /* Write the ClientHello, but block on writing the Client CCS message */ s2n_allowed_writes = 1; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_WRITE, CLIENT_CHANGE_CIPHER_SPEC); EXPECT_EQUAL(data_size, 0); /* Write the Client CCS message, but block on writing the early data */ s2n_allowed_writes = 1; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_WRITE, SERVER_HELLO); EXPECT_EQUAL(data_size, 0); /* Write the early data, but block on reading the ServerHello */ s2n_allowed_writes = 1; s2n_allowed_reads = 0; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_READ, SERVER_HELLO); EXPECT_EQUAL(data_size, sizeof(test_data)); /* Block reading the ClientHello */ s2n_allowed_reads = 0; EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, CLIENT_HELLO); EXPECT_EQUAL(data_size, 0); /* Read the ClientHello, but block on writing the ServerHello */ s2n_allowed_reads = full_record_reads; s2n_allowed_writes = 0; EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_WRITE, SERVER_HELLO); EXPECT_EQUAL(data_size, 0); /* Write the server messages */ while (s2n_conn_get_current_message_type(server_conn) != SERVER_FINISHED) { s2n_allowed_writes = 1; EXPECT_FAILURE_WITH_ERRNO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked), S2N_ERR_IO_BLOCKED); EXPECT_EQUAL(blocked, S2N_BLOCKED_ON_WRITE); EXPECT_EQUAL(data_size, 0); }; /* Write the last server message, but block on reading the early data */ s2n_allowed_writes = 1; s2n_allowed_reads = 0; EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, 0); /* Read the Client CCS message */ s2n_allowed_reads = full_record_reads; EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, 0); /* Read the early data */ s2n_allowed_reads = full_record_reads; EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_size, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_size, sizeof(test_data)); /* Read the ServerHello, but block on writing more early data */ s2n_allowed_reads = full_record_reads; s2n_allowed_writes = 0; EXPECT_BLOCKED_ON_IO(s2n_send_early_data(client_conn, test_data, sizeof(test_data), &data_size, &blocked)); EXPECT_BLOCKED_ON(client_conn, blocked, S2N_BLOCKED_ON_WRITE, ENCRYPTED_EXTENSIONS); EXPECT_EQUAL(data_size, 0); EXPECT_SUCCESS(s2n_connection_free(client_conn)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Known-value early data tests. * The RFC8848s ClientHello uses x25519, which is only available if evp APIs are supported. * Otherwise, skip these tests. */ if (s2n_is_evp_apis_supported()) { DEFER_CLEANUP(struct s2n_psk resumption_psk = { 0 }, s2n_psk_wipe); EXPECT_OK(s2n_psk_init(&resumption_psk, S2N_PSK_TYPE_RESUMPTION)); struct s2n_psk *known_psk = &resumption_psk; /** *= https://tools.ietf.org/rfc/rfc8448#section-3 *= type=test *# {server} generate resumption secret "tls13 resumption": *# *# PRK (32 octets): 7d f2 35 f2 03 1d 2a 05 12 87 d0 2b 02 41 b0 bf *# da f8 6c c8 56 23 1f 2d 5a ba 46 c4 34 ec 19 6c *# *# hash (2 octets): 00 00 *# *# info (22 octets): 00 20 10 74 6c 73 31 33 20 72 65 73 75 6d 70 74 *# 69 6f 6e 02 00 00 *# *# expanded (32 octets): 4e cd 0e b6 ec 3b 4d 87 f5 d6 02 8f 92 2c *# a4 c5 85 1a 27 7f d4 13 11 c9 e6 2d 2c 94 92 e1 c4 f3 */ S2N_BLOB_FROM_HEX(psk_secret,"4e cd 0e b6 ec 3b 4d 87 f5 d6 02 8f 92 2c \ a4 c5 85 1a 27 7f d4 13 11 c9 e6 2d 2c 94 92 e1 c4 f3"); EXPECT_SUCCESS(s2n_psk_set_secret(known_psk, psk_secret.data, psk_secret.size)); /** *= https://tools.ietf.org/rfc/rfc8448#section-3 *= type=test *# {server} construct a NewSessionTicket handshake message: *# *# NewSessionTicket (205 octets): 04 00 00 c9 00 00 00 1e fa d6 aa *# c5 02 00 00 00 b2 2c 03 5d 82 93 59 ee 5f f7 af 4e c9 00 00 00 *# 00 26 2a 64 94 dc 48 6d 2c 8a 34 cb 33 fa 90 bf 1b 00 70 ad 3c *# 49 88 83 c9 36 7c 09 a2 be 78 5a bc 55 cd 22 60 97 a3 a9 82 11 *# 72 83 f8 2a 03 a1 43 ef d3 ff 5d d3 6d 64 e8 61 be 7f d6 1d 28 *# 27 db 27 9c ce 14 50 77 d4 54 a3 66 4d 4e 6d a4 d2 9e e0 37 25 *# a6 a4 da fc d0 fc 67 d2 ae a7 05 29 51 3e 3d a2 67 7f a5 90 6c *# 5b 3f 7d 8f 92 f2 28 bd a4 0d da 72 14 70 f9 fb f2 97 b5 ae a6 *# 17 64 6f ac 5c 03 27 2e 97 07 27 c6 21 a7 91 41 ef 5f 7d e6 50 *# 5e 5b fb c3 88 e9 33 43 69 40 93 93 4a e4 d3 57 00 08 00 2a 00 *# 04 00 00 04 00 */ /* Skip past the message type, message size, ticket lifetime, * ticket age add, nonce, and ticket size: * 04 00 00 c9 00 00 00 1e fa d6 aa * c5 02 00 00 00 b2 */ S2N_BLOB_FROM_HEX(psk_identity, "2c 03 5d 82 93 59 ee 5f f7 af 4e c9 00 00 00 \ 00 26 2a 64 94 dc 48 6d 2c 8a 34 cb 33 fa 90 bf 1b 00 70 ad 3c \ 49 88 83 c9 36 7c 09 a2 be 78 5a bc 55 cd 22 60 97 a3 a9 82 11 \ 72 83 f8 2a 03 a1 43 ef d3 ff 5d d3 6d 64 e8 61 be 7f d6 1d 28 \ 27 db 27 9c ce 14 50 77 d4 54 a3 66 4d 4e 6d a4 d2 9e e0 37 25 \ a6 a4 da fc d0 fc 67 d2 ae a7 05 29 51 3e 3d a2 67 7f a5 90 6c \ 5b 3f 7d 8f 92 f2 28 bd a4 0d da 72 14 70 f9 fb f2 97 b5 ae a6 \ 17 64 6f ac 5c 03 27 2e 97 07 27 c6 21 a7 91 41 ef 5f 7d e6 50 \ 5e 5b fb c3 88 e9 33 43 69 40 93 93 4a e4 d3 57"); EXPECT_SUCCESS(s2n_psk_set_identity(known_psk, psk_identity.data, psk_identity.size)); /* Skip past the total extensions size, early data extension type, * and early data extension size: 00 08 00 2a 00 * 04 */ const uint32_t max_early_data = 0x00000400; EXPECT_SUCCESS(s2n_psk_configure_early_data(known_psk, max_early_data, 0x13, 0x01)); /** ClientHello record * *= https://tools.ietf.org/rfc/rfc8448#section-4 *= type=test *# *# complete record (517 octets): 16 03 01 02 00 01 00 01 fc 03 03 1b *# c3 ce b6 bb e3 9c ff 93 83 55 b5 a5 0a db 6d b2 1b 7a 6a f6 49 *# d7 b4 bc 41 9d 78 76 48 7d 95 00 00 06 13 01 13 03 13 02 01 00 *# 01 cd 00 00 00 0b 00 09 00 00 06 73 65 72 76 65 72 ff 01 00 01 *# 00 00 0a 00 14 00 12 00 1d 00 17 00 18 00 19 01 00 01 01 01 02 *# 01 03 01 04 00 33 00 26 00 24 00 1d 00 20 e4 ff b6 8a c0 5f 8d *# 96 c9 9d a2 66 98 34 6c 6b e1 64 82 ba dd da fe 05 1a 66 b4 f1 *# 8d 66 8f 0b 00 2a 00 00 00 2b 00 03 02 03 04 00 0d 00 20 00 1e *# 04 03 05 03 06 03 02 03 08 04 08 05 08 06 04 01 05 01 06 01 02 *# 01 04 02 05 02 06 02 02 02 00 2d 00 02 01 01 00 1c 00 02 40 01 *# 00 15 00 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *# 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *# 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *# 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 *# 00 00 00 00 00 00 00 00 29 00 dd 00 b8 00 b2 2c 03 5d 82 93 59 *# ee 5f f7 af 4e c9 00 00 00 00 26 2a 64 94 dc 48 6d 2c 8a 34 cb *# 33 fa 90 bf 1b 00 70 ad 3c 49 88 83 c9 36 7c 09 a2 be 78 5a bc *# 55 cd 22 60 97 a3 a9 82 11 72 83 f8 2a 03 a1 43 ef d3 ff 5d d3 *# 6d 64 e8 61 be 7f d6 1d 28 27 db 27 9c ce 14 50 77 d4 54 a3 66 *# 4d 4e 6d a4 d2 9e e0 37 25 a6 a4 da fc d0 fc 67 d2 ae a7 05 29 *# 51 3e 3d a2 67 7f a5 90 6c 5b 3f 7d 8f 92 f2 28 bd a4 0d da 72 *# 14 70 f9 fb f2 97 b5 ae a6 17 64 6f ac 5c 03 27 2e 97 07 27 c6 *# 21 a7 91 41 ef 5f 7d e6 50 5e 5b fb c3 88 e9 33 43 69 40 93 93 *# 4a e4 d3 57 fa d6 aa cb 00 21 20 3a dd 4f b2 d8 fd f8 22 a0 ca *# 3c f7 67 8e f5 e8 8d ae 99 01 41 c5 92 4d 57 bb 6f a3 1b 9e 5f *# 9d */ S2N_BLOB_FROM_HEX(ch_record, "16 03 01 02 00 01 00 01 fc 03 03 1b \ c3 ce b6 bb e3 9c ff 93 83 55 b5 a5 0a db 6d b2 1b 7a 6a f6 49 \ d7 b4 bc 41 9d 78 76 48 7d 95 00 00 06 13 01 13 03 13 02 01 00 \ 01 cd 00 00 00 0b 00 09 00 00 06 73 65 72 76 65 72 ff 01 00 01 \ 00 00 0a 00 14 00 12 00 1d 00 17 00 18 00 19 01 00 01 01 01 02 \ 01 03 01 04 00 33 00 26 00 24 00 1d 00 20 e4 ff b6 8a c0 5f 8d \ 96 c9 9d a2 66 98 34 6c 6b e1 64 82 ba dd da fe 05 1a 66 b4 f1 \ 8d 66 8f 0b 00 2a 00 00 00 2b 00 03 02 03 04 00 0d 00 20 00 1e \ 04 03 05 03 06 03 02 03 08 04 08 05 08 06 04 01 05 01 06 01 02 \ 01 04 02 05 02 06 02 02 02 00 2d 00 02 01 01 00 1c 00 02 40 01 \ 00 15 00 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \ 00 00 00 00 00 00 00 00 29 00 dd 00 b8 00 b2 2c 03 5d 82 93 59 \ ee 5f f7 af 4e c9 00 00 00 00 26 2a 64 94 dc 48 6d 2c 8a 34 cb \ 33 fa 90 bf 1b 00 70 ad 3c 49 88 83 c9 36 7c 09 a2 be 78 5a bc \ 55 cd 22 60 97 a3 a9 82 11 72 83 f8 2a 03 a1 43 ef d3 ff 5d d3 \ 6d 64 e8 61 be 7f d6 1d 28 27 db 27 9c ce 14 50 77 d4 54 a3 66 \ 4d 4e 6d a4 d2 9e e0 37 25 a6 a4 da fc d0 fc 67 d2 ae a7 05 29 \ 51 3e 3d a2 67 7f a5 90 6c 5b 3f 7d 8f 92 f2 28 bd a4 0d da 72 \ 14 70 f9 fb f2 97 b5 ae a6 17 64 6f ac 5c 03 27 2e 97 07 27 c6 \ 21 a7 91 41 ef 5f 7d e6 50 5e 5b fb c3 88 e9 33 43 69 40 93 93 \ 4a e4 d3 57 fa d6 aa cb 00 21 20 3a dd 4f b2 d8 fd f8 22 a0 ca \ 3c f7 67 8e f5 e8 8d ae 99 01 41 c5 92 4d 57 bb 6f a3 1b 9e 5f \ 9d"); /* ApplicationData record containing early data * *= https://tools.ietf.org/rfc/rfc8448#section-4 *= type=test *# {client} send application_data record: *# *# payload (6 octets): 41 42 43 44 45 46 *# *# complete record (28 octets): 17 03 03 00 17 ab 1d f4 20 e7 5c 45 *# 7a 7c c5 d2 84 4f 76 d5 ae e4 b4 ed bf 04 9b e0 */ S2N_BLOB_FROM_HEX(payload, "41 42 43 44 45 46"); S2N_BLOB_FROM_HEX(early_record, "17 03 03 00 17 ab 1d f4 20 e7 5c 45 \ 7a 7c c5 d2 84 4f 76 d5 ae e4 b4 ed bf 04 9b e0") /* EndOfEarlyData record * *= https://tools.ietf.org/rfc/rfc8448#section-4 *= type=test *# *# complete record (26 octets): 17 03 03 00 15 ac a6 fc 94 48 41 29 *# 8d f9 95 93 72 5f 9b f9 75 44 29 b1 2f 09 */ S2N_BLOB_FROM_HEX(end_record, "17 03 03 00 15 ac a6 fc 94 48 41 29 \ 8d f9 95 93 72 5f 9b f9 75 44 29 b1 2f 09"); /* Test s2n_recv_early_data without any blocking */ { struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(server_conn); EXPECT_SUCCESS(s2n_connection_set_blinding(server_conn, S2N_SELF_SERVICE_BLINDING)); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "default_tls13")); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, known_psk)); EXPECT_SUCCESS(s2n_connection_set_server_max_early_data_size(server_conn, max_early_data)); DEFER_CLEANUP(struct s2n_stuffer input = { 0 }, s2n_stuffer_free); DEFER_CLEANUP(struct s2n_stuffer output = { 0 }, s2n_stuffer_free); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&input, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&output, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_connection_set_io_stuffers(&input, &output, server_conn)); EXPECT_SUCCESS(s2n_stuffer_write(&input, &ch_record)); EXPECT_SUCCESS(s2n_stuffer_write(&input, &early_record)); EXPECT_SUCCESS(s2n_stuffer_write(&input, &end_record)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_read = 0; EXPECT_SUCCESS(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_read, &blocked)); EXPECT_NOT_BLOCKED(server_conn, blocked, CLIENT_FINISHED); EXPECT_EQUAL(data_read, payload.size); EXPECT_BYTEARRAY_EQUAL(actual_payload, payload.data, payload.size); EXPECT_EQUAL(server_conn->early_data_state, S2N_END_OF_EARLY_DATA); EXPECT_SUCCESS(s2n_stuffer_free(&input)); EXPECT_SUCCESS(s2n_stuffer_free(&output)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Test s2n_recv_early_data with blocking */ { /* When we block, we should continue to block regardless of how many times the API is called. * Let's choose an arbitrary "retry" test value > 1. */ const size_t repeat_count = 5; struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(server_conn); EXPECT_SUCCESS(s2n_connection_set_blinding(server_conn, S2N_SELF_SERVICE_BLINDING)); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "default_tls13")); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, known_psk)); EXPECT_SUCCESS(s2n_connection_set_server_max_early_data_size(server_conn, max_early_data)); DEFER_CLEANUP(struct s2n_stuffer input = { 0 }, s2n_stuffer_free); DEFER_CLEANUP(struct s2n_stuffer output = { 0 }, s2n_stuffer_free); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&input, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_connection_set_io_stuffers(&input, &output, server_conn)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_read = 0; for (size_t i = 0; i < repeat_count; i++) { EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_read, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, CLIENT_HELLO); EXPECT_EQUAL(data_read, 0); } EXPECT_SUCCESS(s2n_stuffer_write(&input, &ch_record)); for (size_t i = 0; i < repeat_count; i++) { EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_read, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_WRITE, SERVER_HELLO); EXPECT_EQUAL(data_read, 0); } EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&output, S2N_DEFAULT_RECORD_LENGTH)); for (size_t i = 0; i < repeat_count; i++) { EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_read, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_read, 0); } EXPECT_EQUAL(server_conn->early_data_state, S2N_EARLY_DATA_ACCEPTED); EXPECT_SUCCESS(s2n_stuffer_write(&input, &early_record)); EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_read, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_read, payload.size); EXPECT_BYTEARRAY_EQUAL(actual_payload, payload.data, payload.size); for (size_t i = 0; i < repeat_count; i++) { EXPECT_BLOCKED_ON_IO(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_read, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, END_OF_EARLY_DATA); EXPECT_EQUAL(data_read, 0); } EXPECT_EQUAL(server_conn->early_data_state, S2N_EARLY_DATA_ACCEPTED); EXPECT_SUCCESS(s2n_stuffer_write(&input, &end_record)); for (size_t i = 0; i < repeat_count; i++) { EXPECT_SUCCESS(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_read, &blocked)); EXPECT_NOT_BLOCKED(server_conn, blocked, CLIENT_FINISHED); EXPECT_EQUAL(data_read, 0); EXPECT_EQUAL(server_conn->early_data_state, S2N_END_OF_EARLY_DATA); } EXPECT_BLOCKED_ON_IO(s2n_negotiate(server_conn, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, CLIENT_FINISHED); EXPECT_EQUAL(server_conn->early_data_state, S2N_END_OF_EARLY_DATA); EXPECT_SUCCESS(s2n_stuffer_free(&input)); EXPECT_SUCCESS(s2n_stuffer_free(&output)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Test s2n_recv_early_data when early data not allowed for PSK */ { struct s2n_psk psk_copy = *known_psk; EXPECT_SUCCESS(s2n_psk_configure_early_data(&psk_copy, 0, 0x13, 0x01)); struct s2n_psk *known_psk_without_early_data = &psk_copy; struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(server_conn); EXPECT_SUCCESS(s2n_connection_set_blinding(server_conn, S2N_SELF_SERVICE_BLINDING)); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "default_tls13")); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, known_psk_without_early_data)); EXPECT_SUCCESS(s2n_connection_set_server_max_early_data_size(server_conn, max_early_data)); DEFER_CLEANUP(struct s2n_stuffer input = { 0 }, s2n_stuffer_free); DEFER_CLEANUP(struct s2n_stuffer output = { 0 }, s2n_stuffer_free); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&input, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&output, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_connection_set_io_stuffers(&input, &output, server_conn)); EXPECT_SUCCESS(s2n_stuffer_write(&input, &ch_record)); EXPECT_SUCCESS(s2n_stuffer_write(&input, &early_record)); EXPECT_SUCCESS(s2n_stuffer_write(&input, &end_record)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_read = 0; EXPECT_SUCCESS(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_read, &blocked)); EXPECT_NOT_BLOCKED(server_conn, blocked, CLIENT_HELLO); EXPECT_EQUAL(data_read, 0); EXPECT_BLOCKED_ON_IO(s2n_negotiate(server_conn, &blocked)); EXPECT_BLOCKED_ON(server_conn, blocked, S2N_BLOCKED_ON_READ, CLIENT_FINISHED); EXPECT_EQUAL(server_conn->early_data_state, S2N_EARLY_DATA_REJECTED); EXPECT_SUCCESS(s2n_stuffer_free(&input)); EXPECT_SUCCESS(s2n_stuffer_free(&output)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } /* Test s2n_recv_early_data when early data rejected */ { struct s2n_psk psk_copy = *known_psk; EXPECT_SUCCESS(s2n_psk_configure_early_data(&psk_copy, max_early_data, 0x13, 0x03)); struct s2n_psk *known_psk_with_wrong_cipher_suite = &psk_copy; struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(server_conn); EXPECT_SUCCESS(s2n_connection_set_blinding(server_conn, S2N_SELF_SERVICE_BLINDING)); EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "default_tls13")); EXPECT_SUCCESS(s2n_connection_append_psk(server_conn, known_psk_with_wrong_cipher_suite)); EXPECT_SUCCESS(s2n_connection_set_server_max_early_data_size(server_conn, max_early_data)); DEFER_CLEANUP(struct s2n_stuffer input = { 0 }, s2n_stuffer_free); DEFER_CLEANUP(struct s2n_stuffer output = { 0 }, s2n_stuffer_free); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&input, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_stuffer_growable_alloc(&output, S2N_DEFAULT_RECORD_LENGTH)); EXPECT_SUCCESS(s2n_connection_set_io_stuffers(&input, &output, server_conn)); EXPECT_SUCCESS(s2n_stuffer_write(&input, &ch_record)); EXPECT_SUCCESS(s2n_stuffer_write(&input, &early_record)); EXPECT_SUCCESS(s2n_stuffer_write(&input, &end_record)); uint8_t actual_payload[BUFFER_SIZE] = { 0 }; s2n_blocked_status blocked = S2N_NOT_BLOCKED; ssize_t data_read = 0; EXPECT_SUCCESS(s2n_recv_early_data(server_conn, actual_payload, sizeof(actual_payload), &data_read, &blocked)); EXPECT_NOT_BLOCKED(server_conn, blocked, CLIENT_FINISHED); EXPECT_EQUAL(data_read, 0); EXPECT_EQUAL(server_conn->early_data_state, S2N_EARLY_DATA_REJECTED); EXPECT_SUCCESS(s2n_stuffer_free(&input)); EXPECT_SUCCESS(s2n_stuffer_free(&output)); EXPECT_SUCCESS(s2n_connection_free(server_conn)); } } END_TEST(); }
Disrupted expression of mitochondrial NCLX sensitizes neuroglial networks to excitotoxic stimuli and renders synaptic activity toxic The mitochondrial solute carrier family 8 sodium/calcium/lithium exchanger, member B1 (NCLX) is an important mediator of calcium extrusion from mitochondria. In this study, we tested the hypothesis that physiological expression levels of NCLX are essential for maintaining neuronal resilience in the face of excitotoxic challenge. Using an shRNA-mediated approach, we showed that reduced NCLX expression exacerbates neuronal mitochondrial calcium dysregulation, mitochondrial membrane potential (m) breakdown, and reactive oxygen species generation during excitotoxic stimulation of primary hippocampal cultures. Moreover, NCLX knockdownwhich affected both neurons and gliaresulted not only in enhanced neurodegeneration following an excitotoxic insult but also in neuronal and astrocytic cell death under basal conditions. Our data also revealed that synaptic activity, which promotes neuroprotective signaling, can become lethal upon NCLX depletion; expression of NCLX-targeted shRNA impaired the clearance of mitochondrial calcium following action potential bursts, and was associated both with m breakdown and substantial neurodegeneration in hippocampal cultures undergoing synaptic activity. Finally, we showed that NCLX knockdown within the hippocampal cornu ammonis 1 region in vivo causes substantial neurodegeneration and astrodegeneration. In summary, we demonstrated that dysregulated NCLX expression not only sensitizes neuroglial networks to excitotoxic stimuli but also notably renders otherwise neuroprotective synaptic activity toxic. These findings may explain the emergence of neurodegeneration and astrodegeneration in patients with disorders characterized by disrupted NCLX expression or function, and suggest that treatments aimed at enhancing or restoring NCLX function may prevent central nervous system damage in these disease states. The mitochondrial solute carrier family 8 sodium/calcium/ lithium exchanger, member B1 (NCLX) is an important mediator of calcium extrusion from mitochondria. In this study, we tested the hypothesis that physiological expression levels of NCLX are essential for maintaining neuronal resilience in the face of excitotoxic challenge. Using an shRNAmediated approach, we showed that reduced NCLX expression exacerbates neuronal mitochondrial calcium dysregulation, mitochondrial membrane potential ( m ) breakdown, and reactive oxygen species generation during excitotoxic stimulation of primary hippocampal cultures. Moreover, NCLX knockdown-which affected both neurons and glia-resulted not only in enhanced neurodegeneration following an excitotoxic insult but also in neuronal and astrocytic cell death under basal conditions. Our data also revealed that synaptic activity, which promotes neuroprotective signaling, can become lethal upon NCLX depletion; expression of NCLX-targeted shRNA impaired the clearance of mitochondrial calcium following action potential bursts, and was associated both with m breakdown and substantial neurodegeneration in hippocampal cultures undergoing synaptic activity. Finally, we showed that NCLX knockdown within the hippocampal cornu ammonis 1 region in vivo causes substantial neurodegeneration and astrodegeneration. In summary, we demonstrated that dysregulated NCLX expression not only sensitizes neuroglial networks to excitotoxic stimuli but also notably renders otherwise neuroprotective synaptic activity toxic. These findings may explain the emergence of neurodegeneration and astrodegeneration in patients with disorders characterized by disrupted NCLX expression or function, and suggest that treatments aimed at enhancing or restoring NCLX function may prevent central nervous system damage in these disease states. Mitochondrial dysfunction in general-and disturbed mitochondrial calcium signaling in particular-has been linked to death processes in numerous cell types from tissues throughout the body, including the central and peripheral nervous systems. Mitochondrial calcium dyshomeostasis is particularly relevant in the mechanisms underlying excitotoxic cell death and may represent the common denominator triggering cellular loss in a wide range of acute and chronic neurological diseases with excitotoxic components. Indeed, a cascade of events involving extrasynaptic Nmethyl-D-aspartate receptor (NMDAR)-dependent calcium entry, mitochondrial calcium overload, breakdown of the mitochondrial membrane potential ( m ), disrupted energy metabolism, mitochondrial permeability transition, and ultimately cell death is implicated in stroke, traumatic brain and spinal cord injury, Huntington's disease, Parkinson's disease (PD), Alzheimer's disease (AD), amyotrophic lateral sclerosis, and other neuropathologies. Disrupted mitochondrial calcium signaling results from either elevated calcium entry or impeded calcium extrusion. In excitable cells such as neurons, these functions are controlled by the mitochondrial calcium uniporter (MCU), a channel that is powered by the steep m and takes up calcium ions into the inner mitochondrial matrix, followed by the mitochondrial solute carrier family 8 sodium/calcium/lithium exchanger, member B1 (NCLX), which acts at a slower and limiting rate to remove calcium ions. By modulating neuronal MCU expression, we and others have previously shown that MCU-and therewith mitochondrial calcium uptake-tunes neuronal toxicity in that its reduced expression mitigates the effects of excitotoxic stimuli, whereas its overexpression suffices to cause neuronal death. Accordingly, corrections of dysregulated MCU expression or function in models of neurodegenerative diseases such as AD and PD have proven effective for reducing neuronal loss and improving phenotypic outcomes. In a similar vein, recent studies aimed at understanding the pathomechanisms of neurodegenerative disorders, including our own investigations on the role of phosphatase and tensin homolog-induced putative kinase 1 or leucine-rich repeat kinase 2 in PD, have demonstrated that dysregulated NCLX function or expression may be a major contributor to the pathophysiology and neuronal demise encountered in these diseases. In this study, we aimed to improve our understanding of the role NCLX plays in neurodegeneration by investigating its contribution to neuronal health under both excitotoxic conditions and during ongoing synaptic activity. To these ends, we used an RNA interference approach to achieve the acute and molecularly selective knockdown of NCLX in primary hippocampal cultures and the dorsal hippocampus of mice. We found that reduced NCLX expression rendered neurons and neuronal mitochondria vulnerable not only to excitotoxic Nmethyl-D-aspartate (NMDA) stimulation but also to stimuli that trigger synaptic activity and otherwise promote neuronal survival. Moreover, we discovered that NCLX knockdown led to astrodegeneration that-as was the case for neurons-could be seen both in vitro and in the cornu ammonis 1 (CA1) region of the hippocampus in vivo. Our results thus identify intact NCLX expression and function as a key determinant of neuronal and astroglial fate subsequent to NMDAR-mediated and synaptically triggered intracellular calcium rises and point to NCLX as a potentially highly valuable target for the prevention of cell death in excitotoxic and neurodegenerative disease states. NCLX-directed shRNA effectively reduces NCLX expression in primary hippocampal cultures Our principal aim in this study was to explore the possibility that dysregulated NCLX expression plays a pivotal role in excitotoxic cell death within the central nervous system. To test this hypothesis, we employed recombinant adenoassociated viral vectors (rAAVs) to drive the expression of short hairpin RNA (shRNA) directed against the NCLX message in primary hippocampal cultures. More specifically, we designed shRNA sequences against mouse Nclx (shNCLX-1, also referred to as shNCLX, and shNCLX-2) and cloned these behind the U6 small nuclear RNA promoter of an rAAV expression cassette that also drives expression of the red fluorescent protein mCherry in excitatory neurons via the calcium/calmodulin-dependent protein kinase II alpha (CaMK2a) promoter as an infection marker (Fig. 1A). Quantitative reverse transcription polymerase chain reaction (qRT-PCR) analysis revealed that, compared with a control shRNA sequence with no known targets in the mouse genome (shCTRL), rAAV-mediated expression of NCLX-directed shRNA effectively reduced Nclx RNA levels in primary hippocampal cultures starting as early as 5 days after infection, on day in vitro (DIV) 8 (Fig. 1B). Notably, shNCLX (heretofore referred to as shNCLX-1), which targets the mouse NCLX 3 0 untranslated region (3 0 UTR), produced a significantly more efficient knockdown than did shNCLX-2, which targets the NCLX coding sequence (Fig. 1B). qRT-PCR analysis of mCherry RNA levels suggests that this difference is not a consequence of a higher infection efficiency for rAAV-shNCLX compared with rAAV-shNCLX-2 (Fig. S1A). As attempts to validate NCLX knockdown on the protein level using several commercially available antibodies yielded variable results-consistent with a number of recent studies citing the inadequacy of most anti-NCLX antibodies to detect native NCLX protein -we verified the effectiveness of our shRNAs for reducing NCLX protein expression by cotransfecting human embryonic kidney 293 (HEK293) cells with a plasmid driving the coexpression of enhanced GFP (EGFP) and murine NCLX (pAAV-EGFP.T2A.NCLX; Fig. S2A) and plasmids driving the expression of shCTRL, shNCLX, shNCLX-2, or none of these (Fig. S2, B-D). Detection using quantitative PCR of pAAV-EGFP.T2A.NCLX, pAAV-shCTRL, pAAV-shNCLX, and pAAV-shNCLX-2 plasmid DNA in lysates from transfected HEK293 cells was used to confirm equal transfection efficiency between samples. As anticipated, both shRNAs targeting the NCLX message reduced heterologous protein expression. Moreover, consistent with our observations regarding their relative efficacy in reducing Nclx RNA levels in primary hippocampal cultures (Fig. 1B), shNCLX produced a markedly better knockdown than did shNCLX-2 ( Fig. S2, B-D). It is on account of the higher knockdown efficiency of shNCLX compared with shNCLX-2 that-excepting for the experiments represented in Figs. 1, 4, A and B, S1, and S2 (see later)-most subsequent analyses were performed using shNCLX in order to best tease out the consequences of disrupted NCLX expression for neuroglial network viability. Reduced NCLX levels impair mitochondrial calcium signaling, alter the mitochondrial glutathione redox potential, and exacerbate mitochondrial membrane potential breakdown during excitotoxic challenge NCLX is thought to be the primary mediator of mitochondrial calcium extrusion in excitable cells. We therefore reasoned that its knockdown in neurons would impair their recovery from stimulus-triggered mitochondrial calcium rises such as those evoked by brief pharmacological stimulation with NMDA, an in vitro model for excitotoxicity. To test this hypothesis, we performed mitochondrial calcium imaging using the Frster resonance energy transfer (FRET)-based genetically encoded mitochondrial calcium indicator 4mtD3cpv in excitatory neurons coinfected with the aforedescribed shRNA constructs. Coexpression of shCTRL or shNCLX was reliably determined using mCherry fluorescence, and only mCherry + cells were analyzed. Notably, both mCherry and 4mtD3cpv exhibited marked cell-to-cell variability in their basal fluorescence intensity (Fig. S1B). These differences are suggestive of an inhomogeneity in the efficiency of infection between individual neurons that might also result in disparate degrees of NCLX knockdown. Consistent with this idea, and with an important role for NCLX in neuronal mitochondrial calcium homeostasis, NCLX knockdown impaired mitochondrial calcium extrusion, quantified using the cross-talk-and bleaching-corrected FRET ratio (R FRET ), following a brief (30 s) NMDA stimulation, but only in a subset of cells (Fig. 2, A-C). This inhibition of mitochondrial calcium clearance was similar to that mediated by the pharmacological NCLX antagonist, CGP37157 (Fig. 2D). Notably, CGP37157 treatment was associated with a marked reduction in the amplitude of calcium rises (vehicle: increase in R FRET = 0.94 ± 0.06; CGP37157: increase in R FRET = 0.58 ± 0.03; twotailed independent-samples Mann-Whitney test; U = 1884, p < 0.0001), probably because of an unspecific inhibitory effect of CGP37157, for instance on L-type voltage-gated calcium channels. NCLX knockdown also inhibited mitochondrial calcium clearance following more robust excitotoxic stimuli lasting 120 s (Fig. 2E) and 300 s (Fig. 2F). In these cases, however, the population of rAAV-shNCLX-infected cells exhibited a more uniform disruption of mitochondrial calcium recovery. NMDA stimuli lasting 120 s, but not 30 s or 300 s stimulus, evoked larger amplitude mitochondrial calcium rises in rAAV-shNCLX-infected cells than in rAAV-shCTRL-infected cells (Fig. 2G). Moreover, as expected, longer-lasting stimuli were associated with larger amplitude mitochondrial calcium rises (Fig. 2G). In sum, these results indicate that NCLX knockdown results in a functional inhibition of mitochondrial calcium recovery. Altered cellular oxidation-reduction equilibrium (redox state) and oxidative stress represent early events in mitochondrial dysfunction, and increased reactive oxygen species (ROS) production can trigger neuronal damage and death. Excitotoxic stimuli-modeled by the stimulation of NMDARs via bath application of NMDA as in this study-have been shown to increase ROS production in cultures of both cerebellar granule cells and forebrain neurons subsequent to excessive mitochondrial calcium influx. Previous studies indeed indicate that knockdown of NCLX expression enhances mitochondrial ROS production. We therefore reasoned that disruption of mitochondrial calcium clearance following NCLX knockdown would exacerbate mitochondrial redox state disruption in neurons challenged with NMDA. To test this hypothesis, we employed the mitochondrial matrix-targeted ratiometric glutathione redox potential indicator, mito-Grx1-roGFP2, to assess the mitochondrial redox state following NMDA bath application in neurons infected with rAAV-shCTRL or rAAV-shNCLX. In these experiments, the mito-Grx1-roGFP 405/480 ratio, R (expressed as a fraction of R max, the maximum ratio achieved by treatment of cells with the oxidizing reagent diamide) was measured prior to and during NMDA application. Compared with rAAV-shCTRL-infected neurons, rAAV-shNCLXinfected neurons were both more highly oxidized at baseline (Fig. 3, A-C) and exhibited a more pronounced NMDAtriggered increase in oxidation (Fig. 3, A, B, and D). These data confirm that intact NCLX expression is important for maintaining mitochondrial redox state under basal conditions and following an excitotoxic challenge. NCLX knockdown enhances neuronal death at baseline and following excitotoxic challenge To assess whether NCLX knockdown indeed renders neurons more susceptible to death following milder excitotoxic insults, we examined the levels of cell death in primary cultures infected with rAAV-shCTRL or rAAV-shNCLX and challenged with different concentrations of NMDA. In line with our observations that NCLX knockdown sensitized m to breakdown following a mild excitotoxic stimulus and that the mitochondrial redox state was disturbed even at baseline, we found that vehicle-stimulated rAAV-shNCLX-infected cells (control) and rAAV-shNCLXinfected cells that were stimulated with NMDA (5, 10, or 20 M) exhibited higher levels of cell death than rAAV-shCTRLinfected cells (Fig. 3H). Furthermore, cell death rates were generally greater for higher NMDA concentrations (Fig. 3H). Higher levels of cell death in NMDA-treated rAAV-shNCLXinfected cells could be due to higher sensitivity to NMDA or could simply result from higher levels of basal cell death. To distinguish between these possibilities, we calculated the NMDA-dependent probability of a cell dying (see the Experimental procedures section for details). This analysis revealed that rAAV-shNCLXinfected cells are indeed more sensitive to NMDA than rAAV-shCTRL-infected cells (Fig. 3I). Thus, consistent with its effect on mitochondrial health, knockdown of NCLX increases neuronal susceptibility to excitotoxic insults. NCLX knockdown decreases the viability of neurons and glia We next assessed in more detail how decreased NCLX expression impacts cell health in the absence of any excitotoxic stimulus. In these experiments, we used two different viral infection rates in order to gain better insight into how NCLX levels impact cell survival: 7 10 8 viral particles/ml (Fig. 4, A and C) and a threefold higher infection, 2 10 9 viral particles/ ml (Fig. 4, B and D). This rAAV-shNCLX infection rate was associated with only slightly higher basal cell death rates than rAAV-shCTRL infection on DIV 8, but with dramatically higher basal cell death rates on DIV 10 (Fig. 4, A and E). Consistent with the idea that cell death is linked to NCLX knockdown rather than a nonspecific effect of rAAV-shNCLX, we also confirmed a statistically significant increase in basal cell death rates for shNCLX-2 at this infection rate on DIV 10 ( Fig. 4A). Increasing the viral load by three times to 2 10 9 viral particles/ml, which resulted in a significantly greater reduction of Nclx RNA on DIV 10 (shNCLX/shCTRL: 7 10 8 particles/ml 0.30 ± 0.11, n = 15, 2 10 9 particles/ml 0.11 ± 0.04, n = 5; shNCLX-2/shCTRL: 7 10 8 particles/ml 0.57 ± 0.25, n = 9, 2 10 9 particles/ml 0.28 ± 0.00, n = 2; ordinary two-way ANOVA followed by Tukey's multiple comparisons test; main effect of infection rate F = 10.79, p = 0.0027; shNCLX/shCTRL q These data indicate that the extent to which NCLX expression is reduced from basal levels is a determinant for its impact on neuronal health. It has been reported that NCLX is considerably more highly expressed by astrocytes than neurons. Moreover, the rAAV expression system we employed (serotype 1/2) is capable of mediating transgene expression in astrocytes (e.g., ) and drives the expression of shRNA under the control of a ubiquitous eukaryotic RNA polymerase III U6 promoter. It thus seems plausible that not only neurons but also astrocytes may be affected by rAAV-shNCLX infection in our p < 0.0001, 300 s Z = 6.441, p < 0.0001, and 540 s Z = 6.872, p < 0.0001). E and F, quantification of the decay of NMDA-evoked mitochondrial calcium rises in rAAV-shCTRL and rAAV-shNCLX 45, 90, 300, and 540 s after NMDA washout (normalized to the peak NMDA response) for stimuli lasting 120 s (E; shCTRL n = 35 cells from three coverslips and three independent preparations, shNCLX n = 48 cells from four coverslips and three independent preparations; Kruskal-Wallis test followed by Dunn's multiple comparisons test; shNCLX versus shCTRL: 45 s Z. shRNA-mediated knockdown of NCLX alters the mitochondrial redox state, sensitizes m to breakdown, and renders cells more vulnerable to excitotoxic stimuli. A-D, NMDA (20 M) was applied to primary hippocampal cultures coinfected with rAAVs driving the expression of mito-Grx1-roGFP2 and either shCTRL or shNCLX. Complete oxidation of the sensor was achieved with 0.5 mM diamide (shCTRL: n = 171 cells from eight coverslips and three independent preparations; shNCLX: n = 119 cells from eight coverslips and three independent preparations). A and B, representative levels of the mito-Grx1-roGFP 405/480 ratio, R (expressed as a fraction of the maximum ratio observed during diamide treatment, R max ) prior to and during NMDA application in rAAV-shCTRL-infected (A) and rAAV-shNCLX-infected neurons (B) on a single coverslip each (gray, individual cells; black, their mean). C, quantification of baseline R/R max in rAAV-shCTRL-infected and rAAV-shNCLX-infected neurons measured in the last 10 s prior to NMDA (two-tailed independent-samples Mann-Whitney test; U = 7265, p < 0.0001). D, changes in mitochondrial redox state quantified as the amplitude of the baseline-subtracted R/R max ratio following 10 min of NMDA treatment (two-tailed independent-samples Mann-Whitney test; U = 4905, p < 0.0001). E-G, NMDA (5, 10, or 20 M) was applied to primary hippocampal cultures loaded with Rh123 and infected with rAAVs driving the expression of either shCTRL or shNCLX. The mitochondrial uncoupler FCCP (5 M) was used to trigger complete m breakdown (5 M NMDA: shCTRL n = 185 cells from seven coverslips and five independent preparations, shNCLX n = 103 cells from five coverslips and four independent preparations; 10 M NMDA: shCTRL n = 133 cells from five coverslips and four independent preparations, shNCLX n = 122 cells from five coverslips and four independent preparations; 20 M NMDA: shCTRL n = 160 cells from four coverslips and four independent preparations, and shNCLX n = 91 cells from four coverslips and four independent experimental setup. In addition to quantifying overall cell death rates in cultures infected with NCLX-targeted shRNA (Fig. 4, A and B), we therefore also quantified viable cells immunopositive for the astrocytic marker protein glial fibrillary acidic protein (GFAP) (Fig. 4, C and D). In keeping with the idea that NCLX knockdown leads to astrocytic cell death, we found a significantly smaller proportion of viable GFAP + cells on DIV 10 for both our standard infection rate (Fig. 4C) and for the three-times greater infection rate (Fig. 4, D and E) in cultures that had been infected with rAAV-shNCLX compared with those infected with rAAV-shCTRL. Moreover, like the overall basal cell death rate, this effect was greater for the higher infection rate on DIV 10 (DIV 8: twotailed independent-samples t test; t = 0.3946, p = 0.7049; DIV 10: two-tailed independent-samples t test; t = 6.813, p = 0.0003). The observed reduction in numbers of GFAP + cells in rAAV-shNCLX-infected cultures is unlikely to reflect an impairment of glial cell proliferation, since the proportion of GFAP + cells in sister cultures infected with rAAV-shCTRL either was decreased (7 10 8 viral particles/ml infection: DIV 8 17.74 ± 2.57%; DIV 10 13.70 ± 2.74%; two-tailed pairedsamples t test; t = 3.831, p = 0.0122) or was unchanged in this time frame (2 10 9 viral particles/ml infection: DIV 8 22.21 ± 1.85%; DIV 10 22.00 ± 1.62%; two-tailed paired-samples t test; t = 0.6310, p = 0.5926). Thus, NCLX knockdown leads to a dose-dependent loss of both neurons and astrocytes between DIV 8 and DIV 10 in our primary hippocampal cultures. Astrocytes are known to provide metabolic and redox homeostatic, signaling, and structural supports to neurons and are as such important for maintaining their function and survival. We therefore questioned whether neuronal loss induced by NCLX knockdown in our primary cultures may be a secondary consequence of mitochondrial dysregulation and associated degeneration of astrocytes rather than a direct consequence of reduced neuronal expression of NCLX. To address this question, we prepared nominally glia-free neuronal and nominally neuron-free glial cultures and compared the effects of NCLX knockdown in these cultures to those observed in mixed hippocampal cultures cultivated using our standard methodology. We confirmed the relative purity of our neuronal cultures infected with rAAV-shCTRL immunocytochemically, wherein we observed an average of 0.78 ± 0.02% GFAP + cells compared with 11.06 ± 1.63% in mixed sister cultures also infected with rAAV-shCTRL (twotailed paired-samples t test; t = 6.269, p = 0.0033) and via qRT-PCR analysis of the astrocyte-specific and neuronspecific genes aquaporin 4 (Aqp4) and maternally expressed 3 (Meg3), respectively, for both neuronal and glial cultures compared with mixed sister cultures (Fig. 5A). As expected, glial cultures were enriched for and neuronal cultures depleted of the astrocytic gene Aqp4 compared with mixed cultures (Fig. 5A). Glia were also depleted of the neuronal gene Meg3, whereas neuronal cultures did not express significantly different levels of Meg3 compared with mixed cultures (Fig. 5A). Expression of both Aqp4 and Meg3 was significantly different between neuronal and glial cultures (Fig. 5A). We also evaluated the expression levels of Nclx, Mcu, Micu1, Ppargc1a, and Vdac1 in both rAAV-shCTRL-infected and rAAV-shNCLX-infected cells (Fig. 5, B and C). Consistent with previous reports, we observed significant cell typedependent differences in the relative expression levels of not only Nclx and Vdac1 in our cultures 64) but also in Mcu and Ppargc1a (Fig. 5B). rAAV-shNCLX infection resulted in a significant reduction of Nclx expression in all culture types (Fig. 5C). Compared with cells infected with rAAV-shCTRL, Mcu expression was reduced in mixed and neuronal but not glial cultures; Ppargc1a expression increased in glial but not mixed or neuronal cultures; and Vdac1 expression was increased in glial but decreased in mixed and neuronal cultures infected with rAAV-shNCLX (Fig. 5C). Taken together, these results indicate that NCLX-directed shRNA expressed under control of the U6 promoter results in reduced Nclx expression in both neurons and glia, but that NCLX knockdown disrupts expression of mitochondrial function-related genes in neurons and glia differently. We next performed an analysis of cell death in nominally glia-free neuronal and neuron-free glial cultures compared with mixed hippocampal cultures cultivated in parallel to determine whether NCLX knockdown-induced neuronal death could be uncoupled from any effects on astrocytes and vice versa. Consistent with the now accepted idea that neuron-glia interactions are essential for neuronal cell homeostasis and survival, we detected higher levels of basal preparations). E and F, representative nuclear Rh123 fluorescence (expressed as a percent of the FCCP-triggered fluorescence maximum, with baseline set to 0%) during 10 M NMDA treatment in rAAV-shCTRL-infected (E) and rAAV-shNCLX-infected neurons (F) on a single coverslip each (gray, individual cells; black, their mean). G, quantification of m loss as the peak amplitude during the first 10 min of NMDA treatment (Kruskal-Wallis test followed by Dunn's multiple comparisons test; shCTRL versus shNCLX cell death in neuronal cultures than in mixed cultures (Fig. 5D). Furthermore, NCLX knockdown resulted in a significant increase in the levels of cell death not only in mixed cultures but also in nominally pure neuronal cultures (Fig. 5D). NCLX knockdown renders synaptic activity neurotoxic After a culturing period of 10 or more days, primary hippocampal neurons have established a rich network of synaptic connections, express functional -amino-3-hydroxy-5-methyl-4-isoxazolepropionic acid/kainate and NMDA receptors, and demonstrate spontaneous synaptic activity and action potential firing. It therefore stands to reason that the elevated basal cell death we observed to be associated with NCLX knockdown may result from dysregulated mitochondrial calcium signaling and m breakdown during spontaneous neuronal activity. To address this hypothesis, we first aimed to test whether limiting synaptic activity during the last 2 days of culture may provide some level of neuroprotection to cultures infected with rAAV-shNCLX. In this vein, we cultivated primary hippocampal cells from DIV 8 to DIV 10 in culture medium containing a slightly reduced concentration of potassium ions (K + ), as we have observed during our calcium imaging studies that the K + concentration employed-which we estimate lowers the resting membrane potential by approximately 4.7 mV compared with control culture medium -reduces spontaneous action potential generation in our culture system (unpublished observations). Although there was no significant statistical interaction between shRNA and culture medium on cell death rates, cultures infected with 2 10 9 viral particles/ml and grown under these conditions did exhibit slightly lower levels of basal death than those grown in control medium (control shCTRL 16.6 ± 2.8%, control shNCLX 56.0 ± 1.9%, reduced K + shCTRL 13.8 ± 2.9%, reduced K + shNCLX 50.9 ± 3.2%; n = 4 for all conditions; repeated-measures two-way ANOVA; main effect of shRNA F = 234.5, p = 0.0006; main effect of culture medium F = 4.147, p = 0.1345; shRNA culture medium F = 5.657, p = 0.0978). Since the complete blockade of synaptic activityachieved for instance by cultivation in the voltage-dependent sodium channel antagonist tetrodotoxin-is itself neurotoxic (e.g.,, and unpublished observations), we next aimed to determine whether enhancement of synaptic activity could exacerbate basal cell death in rAAV-shNCLX-infected cultures. To these ends, we applied the gamma-aminobutyric acid (GABA) A receptor (GABA A R) antagonist bicuculline to primary hippocampal cultures to remove tonic inhibition and induce action potential bursting for a period of 20 min or 24 h and fixed the cells for cell death analysis 24 h after antagonist application. As in our previous experiments, rAAV-shNCLXinfected cells exhibited higher levels of cell death than rAAV-shCTRL-infected cells (Fig. 6A). Moreover, in rAAV-shNCLX-infected cultures, but not rAAV-shCTRL-infected cultures, 24 h of bicuculline treatment resulted in significantly greater levels of cell death than control (Fig. 6A), and the probability of rAAV-shNCLX-infected cells dying was greater in rAAV-shNCLX-infected cells for the 24 h bicuculline treatment (Fig. 6B). In parallel to these cell death analyses, we also employed the GABA A R antagonist gabazine to examine whether NCLX knockdown could impair the recovery of synaptic activity-associated mitochondrial calcium rises and whether action potential bursting could trigger m breakdown in cells infected with rAAV-shNCLX. Our data demonstrate that NCLX knockdown did inhibit the decay of action potential-induced mitochondrial calcium transients at time points ≥300 s after a single burst (Fig. 6C) without affecting the amplitudes of evoked calcium transients (shCTRL increase in R FRET = 0.89 ± 0.03, n = 159 cells from three coverslips and three independent preparations; shNCLX increase in R FRET = 0.87 ± 0.03, n =158 cells from three coverslips and three independent preparations; two-tailed independent-samples t test; t = 0.3331, p = 0.7393). Moreover, for trains of action potential bursts lasting 20 min, NCLX knockdown was associated with a loss of m that was not observed in rAAV-shCTRL-infected neurons (Fig. 6, D-F; Movies S1 and S2). This was made evident via quantification of the amplitude of the Rh123 signal during this same time frame (Fig. 6F). To confirm that synaptic activity-induced m loss in rAAV-shNCLX-infected neurons resulted from mitochondrial calcium overload, we inhibited mitochondrial calcium influx pharmacologically using the MCU blocker ruthenium 360 (Ru360). Indeed, MCU antagonism with Ru360 prevented the breakdown of m in rAAV-shNCLX-infected neurons during gabazine-triggered action potential bursting (Fig. 6F). To determine whether reduced activity-dependent induction of neuroprotective signaling pathways might contribute to cellular demise in cultures infected with rAAV-shNCLX, we in addition assessed the synaptic activitydependent expression of several immediate early genes: activity regulated cytoskeletal-associated protein (Arc), activating transcription factor 3 (Atf3), brain derived neurotrophic factor (Bdnf), FBJ osteosarcoma oncogene (cFos), and neuronal PAS domain protein 4 (Npas4). For all genes analyzed, we observed a significant activity-dependent upregulation for both shCTRL-infected and shNCLX-infected cultures (Fig. 7, A-E). Furthermore, while our data did not show any difference in basal expression levels, cultures infected with rAAV-shNCLX did exhibit a significantly reduced upregulation of two analyzed genes, Atf3 and Bdnf (Fig. 7, A-E). These data indicate that the activity-dependent activation of gene transcription remains largely intact in rAAV-shNCLX-infected cells. Interestingly, in rAAV-shCTRL-infected cells, Nclx expression levels decreased after 24 h bicuculline exposure (Fig. 7F). In sum, although synaptic activity is widely considered to be neuroprotective (41,, our findings suggest that even minor deficits in mitochondrial calcium extrusion during synaptic activity may-in the face of repeated synaptic activation-push neuronal mitochondria toward a pathologically depolarized state that cannot be accommodated for by the simultaneous induction of immediate early and neuroprotective genes. Thus, dysregulated NCLX expression-in addition to making neurons more vulnerable to excitotoxic stimuli-has the potential to render synaptic activity neurotoxic. NCLX knockdown in vivo is toxic for both neurons and glia As a final measure, to assess whether NCLX dysregulation could lead to neuron and/or astrocyte loss in vivo, we performed a proof-of-principle experiment to assess cellular viability in the CA1 region of the hippocampus of mice that had been injected 4 weeks prior with rAAVs driving the When used, Ru360 was present in the culture medium ≥30 min prior to and during the entire course of the experiment. The mitochondrial uncoupler FCCP (5 M) was used to trigger complete m breakdown. D and E, representative changes in nuclear Rh123 fluorescence changes to gabazine stimulation in rAAV-shCTRL-infected (D) and rAAV-shNCLX-infected cells (E) on a single coverslip each (gray, individual cells; black, their mean). F, quantification of changes in m (gabazine: shCTRL n = 194 cells from six coverslips and five preparations, shNCLX n = 171 cells from four coverslips and three preparations; gabazine/Ru360: shCTRL n = 121 cells from three coverslips and three preparations, shNCLX n = 132 cells from four coverslips and three preparations), expressed as the peak amplitude of the nuclear Rh123 intensity during 20 min gabazine stimulation (Kruskal-Wallis test followed by Dunn's multiple comparisons test; shCTRL versus shNCLX: gabazine Z = 8.770, p < 0.0001, gabazine + Ru360 Z = 0.5102, p = 0.6099). ns, *p < 0.05, **p < 0.01, ***p < 0.001, and ****p < 0.0001. Bar graphs show the mean + SEM. Violin plots show the probability density of the data as well as median and quartile divisions. Bic, bicuculline; CamK2a, calcium/calmodulin dependent protein kinase II alpha; FCCP, carbonyl cyanide-p-trifluoromethoxyphenylhydrazone; FRET, Frster resonance energy transfer; GABA A R, gamma-aminobutyric acid (GABA) A receptor; MCU, mitochondrial calcium uniporter; NCLX, solute carrier family 8 sodium/calcium/lithium exchanger, member B1; ns, not significant; rAAV, recombinant adeno-associated viral vector; Rh123, rhodamine 123; Ru360, ruthenium 360; m, mitochondrial membrane potential. expression of shNCLX in one hemisphere and shCTRL in the contralateral hemisphere (Fig. 8, A and B). Tissue slices subsequently processed using Fluoro-Jade C (FJC) to stain dead and dying neurons exhibited broad patches of FJC-labeled cells in the hemisphere infected with rAAV-shNCLX but not in the contralateral hemisphere that was infected with rAAV-shCTRL in all three mice (Fig. 8A). A quantitative analysis of the area of FJC stain within stratum pyramidale (s.p.) yielded a significant difference between rAAV-shCTRL-infected and rAAV-shNCLX-infected hemispheres (Fig. 8C). Images of mCherry fluorescence from adjacent tissue slices showed that infection rates of rAAV-shNCLX and rAAV-shCTRL were qualitatively similar. Moreover, the density of anti-GFAP immunolabel within stratum radiatum (s.r.) was significantly reduced (Fig. 8, B and D), and the numbers of shrunken and dysmorphic nuclei in CA1 s.p. markedly increased in the rAAV-shNCLX-infected hemisphere (Fig. 8B). Notably, dysmorphic nuclei and loss of GFAP immunoreactivity were predominantly observed in those areas of the hippocampus where, in adjacent slices, FJC-labeled cells could be readily visualized. These data confirm that NCLX knockdown dramatically diminishes neuronal and astrocyte viability under basal conditions in vivo and underlines the potential importance of our main findings for neurological diseases associated with dysregulated NCLX expression. Discussion In this study, we investigated the effects of dysregulated expression of the mitochondrial NCLX on neuroglial vulnerability under both excitotoxic conditions and during ongoing synaptic activity. Our results revealed that the shRNAmediated knockdown of NCLX, as expected, impairs mitochondrial calcium clearance and not only sensitizes neurons to excitotoxic stimuli but also renders synaptic activity toxic. Our results further show that NCLX knockdown diminishes the viability of astroglia. These findings underscore the relevance of intact mitochondrial calcium extrusion mechanisms for determining neuroglial fate not only in the face of excitotoxic challenge but also during otherwise cell survival-promoting synaptic activity. The data we present here show that impaired NCLX expression rendered neurons more sensitive to excitotoxic stimuli (Figs. 2 and 3). As such, our findings are consistent with several studies in diverse models of neurodegenerative diseases that point to mitochondrial dysfunction as a core trigger for excitotoxic cell death in neurodegenerative disease. Our data demonstrate as well that dysregulated NCLX expression is associated with the toxification of synaptic activity (Fig. 6), although neuronal activation of this nature is widely understood to be neuroprotective (41,. Transcriptional regulation appears largely intact in cells where NCLX expression was knocked down as synaptic activity was associated with the induction of several immediate early genes (Fig. 7), including ones whose upregulation has been demonstrated to confer neuroprotection. Indeed, periodic bursts of synaptic activity are known to activate a nuclear calcium-dependent transcriptional program that enhances neuronal resilience in the face of proapoptotic and excitotoxic stimuli. This so-called acquired neuroprotection seems to hinge primarily upon alterations that affect mitochondrial structure and function and includes the transcriptional repression of MCU, which protects cells from not only mitochondrial calcium overload, oxidative damage, and permeability transition but also the upregulation of antioxidant defense genes, and a potential metabolic shift in neurons from oxidative phosphorylation toward aerobic glycolysis. Our data demonstrate that, while the pathological reduction of NCLX expression does not grossly disrupt activity-dependent gene induction (Fig. 7), evoked-and presumably also basal-synaptic activity is nonetheless rendered toxic (Figs. 4, 6, and 8). These findings lend support to the growing consensus that more work must be done to uncover new therapeutic approaches that limit or prevent mitochondrial calcium overload in acute and chronic neurodegenerative disease. Our observation that NCLX expression was decreased following extended periods (24 h) of synaptic activity (Fig. 6) may seem, at first thought, to contradict the idea that a consequence of synaptic activity is the reduction of mitochondrial calcium influx and a shift away from calciumdependent oxidative phosphorylation. Activity-dependent decreases in MCU expression can be seen after as little as 4 h of synaptic activity. It is reasonable that a subsequent compensatory decrease in NCLX expression might follow. Clearly, a more thorough time-course analysis of the expression changes of these two integral components of the mitochondrial calcium signaling machinery would provide more insight into the physiological responses of healthy neurons' mitochondria to synaptic activity. Long-lasting excitotoxic stimuli in rAAV-shCTRL-infected cells in our study evoked mitochondrial calcium rises that failed to recover after removal of the stimulus (Fig. 2). By contrast, even longer-lasting excitotoxic stimuli of the same magnitude failed to elicit a change in the mitochondrial redox potential or m in similarly rAAV-shCTRL-infected cells (Fig. 3). While this disparity between mitochondrial calcium recovery, redox potential changes, and m breakdown in response to an excitotoxic stimulus may at first glance seem surprising given the established links between mitochondrial calcium dysregulation and the mechanisms underlying excitotoxic cell death, there is precedent that a sustained cytoplasmic (and presumably also mitochondrial) calcium rise does not necessarily lead to the breakdown of m or to neuronal death. Accordingly, observations such as those made here (Figs. 2 and 3) indicate that a prolonged mitochondrial calcium signal may not, per se, trigger the loss of physiological mitochondrial function and neuronal cell death. An additional perturbation, such as the strong activation of extrasynaptic NMDAR-linked signaling or-as shown here-the disrupted expression of NCLX, and therewith the loss of intact mitochondrial calcium extrusion mechanisms, is required to render mitochondrial calcium dysregulation toxic. Further investigations clarifying the precise and clearly complex relationships between mitochondrial calcium levels, m breakdown, and redox signaling as well as cell death in the face of both excitotoxic stimuli and synaptic activity are warranted. NCLX knockdown in our study was accompanied by decreases in the neuronal expression of Mcu and Vdac1 and a trend toward or a decrease in the expression of Micu1 (Figs. 1 and 5). Endogenous loss of NCLX has been observed in humans and mouse models of AD, where it was similarly accompanied by changes in the levels of the MCU-associated proteins MICU1 and MICUB. Given that we could not identify any changes in the expression of Tfam or of any analyzed mitochondrial genes (Figs. 1 and 5), it seems unlikely that the downregulated expression of Mcu, Micu1, or Vdac1 genes is reflective of neuronal mitophagy. The decreased expression of these genes, the protein products of which control mitochondrial calcium influx, would be expected to result in diminished mitochondrial calcium entry and provide some measure of neuroprotection. On the other hand, the decreased expression or activity of NCLX has been associated in some studies with larger amplitude-evoked mitochondrial calcium transients. We only observed significant differences in the amplitudes of evoked mitochondrial calcium signals in cells infected with NCLX-targeted shRNA for NMDA stimuli lasting 120 s but not for brief (30 s) or prolonged (300 s) stimuli (Fig. 2). It thus seems possible that the decreased expression of Mcu, Micu1, and Vdac1 we observed in cells infected with rAAV-shNCLX may be part of a compensatory response to prolonged mitochondrial calcium transients triggered by NCLX knockdown. NCLX knockdown in astrocytes was accompanied by the increased expression of Ppargc1a, a positive regulator of mitochondrial biogenesis and respiration 78), and Vdac1, a gatekeeper for the mitochondria-to-cytoplasm transport of metabolites, including pyruvate (Fig. 5). Together, these changes suggest that astrocytes may compensate for the loss of mitochondrial calcium homeostasis and almost certain metabolic disturbance by an upregulation of mitogenesis. On the other hand, elevated VDAC1 expression and subsequent oligomerization have been proposed to constitute a focal point in apoptotic signaling cascades, also in the context of neurodegenerative disease. One might therefore expect an increase in VDAC1 expression to render astrocytes more prone to apoptosis. Alternatively, in light of the fact that astrocytes cultivated in the absence of neurons exhibit an immature phenotype in terms of their gene expression, morphology, and metabolism, both the altered mitochondrial gene expression patterns related to and the functional consequences of knocking down NCLX for astrocytic function may be different in astrocytes cultivated under conditions more closely resembling the physiological state. In accordance with this idea, although we found the difference in basal cell death rates of shNCLX-infected compared with shCTRL-infected glial cultures to be statistically significant, the overall rate of shNCLX-associated loss of astrocytes in nominally pure cultures was far lower than that observed for these cells in a mixed culture system (Figs. 4 and 5). It will be exciting to discover in future studies how pathologically reduced NCLX expression and/or function influences neuronal and glial mitogenesis/mitophagy as well as both cell autonomous and intercellular metabolism and metabolic signaling. Although astroglial functions are impaired in neurodegenerative diseases, and while these impairments are known to involve dysregulated intracellular calcium signaling and mitochondrial function, astrocytes have been largely ignored in studies addressing mitochondrial calcium signaling in the context of excitotoxicity and neurodegeneration. One exception is a very recent study examining the influence of tau protein on cytosolic and mitochondrial calcium homeostasis. In this article, which focused primarily on neurons, the authors demonstrated that treatment of neurons or astrocytes in culture with the K18 repeat domain fragment of tau inhibited the recovery of evoked mitochondrial calcium transients in these cells. On this background, our observation that NCLX knockdown impacts astrocyte viability (Figs. 4 and 8) indicates that these cells may represent a mostly overlooked target of tau pathology in early stages of AD. Indeed, prior to the development of senile plaques and local astrogliosis, AD is associated with astroglial atrophy and asthenia that may both impair metabolic support of neurons and contribute to and right). *p < 0.05. Bar graphs show the mean + SEM. CA1, cornu ammonis 1; FJC, Fluoro-Jade C; GFAP, glial fibrillary acidic protein; NCLX, solute carrier family 8 sodium/calcium/lithium exchanger, member B1; pCaMK2a, calcium/calmodulin-dependent protein kinase II alpha promoter; pU6, U6 small nuclear RNA promoter; rAAV, recombinant adeno-associated viral vector; s.p., stratum pyramidale; s.r., stratum radiatum. synapse loss. Further detailed studies aimed at specifically examining the consequences of NCLX loss or dysfunction on astrocytes' morphological stability and metabolic capacity will be necessary, however, to understand the implications of these observations for AD and other pathologies. In this study, we employed viral-mediated delivery of shRNA as a means to experimentally manipulate NCLX expression in neurons and glia (Figs. 1 and 5). Compared with the use of an NCLX knockout, this approach has the advantage that NCLX expression can be reduced at a later stage in development, thus precluding the activation of unpredictable compensatory mechanisms early in development. rAAV infection simultaneously has the disadvantage that transgeneor shRNA-expression levels can exhibit a high degree of cell-to-cell variability (Fig. S1). Because of the lack of appropriate commercially available anti-NCLX antibodies, it was not possible in this study to directly examine NCLX protein expression at the single cell level or to relate such parameters as mitochondrial calcium recovery, m breakdown, or cellular viability to the degree of NCLX knockdown. Our observation that higher rAAV-shNCLX infection rates resulted in lower Nclx RNA levels and diminished viability compared with a lower infection rate (Fig. 4) nonetheless supports the idea that degree of NCLX dysregulation may be a key defining factor for determining how a given cell or population of cells will respond to synaptic activity or excitotoxic challenge. Indeed, we believe that the variability of mitochondrial calcium recovery rates (Fig. 2) and m changes (Fig. 3) in our data-particularly in response to shorter-lasting or less intense excitotoxic stimuli-are most likely attributable to cell-intrinsic differences in NCLX knockdown. Future analyses comparing NCLX expression levels and mitochondrial calcium recovery rates or m changes on a cell-by-cell basis will be revealing in this regard. Endogenously reduced NCLX expression has been implicated in neuronal toxicity in both Friedreich's ataxia and AD. Jadiya et al. demonstrated, for instance, that downregulated NCLX expression and subsequent changes in mitochondrial calcium handling may contribute to the pathophysiology of AD. In this study, the authors report an uncompensated and profound loss of NCLX expression in the cortex of AD patients and in mouse models of AD and demonstrate that genetic restoration of NCLX expression prevents cognitive decline and AD pathology in the mouse. Cell type-specific effects of dysregulated NCLX expression were not, however, explored. The data we present here show that dysregulated NCLX expression is detrimental for the proper functioning and survival not only of neurons but also for the survival of astrocytes (Figs. 4 and 8) and so are in line with previous studies employing siRNA to knock down NCLX expression in this cell type. Moreover, our observation that not only the number of astrocytes but also the proportion of viable cells identified as astrocytes was diminished in cultures where NCLX expression was experimentally reduced (Fig. 4) suggests that these cells are particularly sensitive to the perturbed expression of proteins involved in maintaining mitochondrial homeostasis. Given that NCLX is so much more highly expressed by astrocytes than by neurons, and that Jadiya et al. observed a near complete loss of NCLX expression in mouse AD models, it seems quite possible that dysregulated mitochondrial calcium signaling in glia contributes to neuronal compromise and functional deficits in AD pathology. Whether and how glial mitochondrial calcium mishandling plays a role in Friedreich's ataxia remains to be explored, but a functional effect seems likely. Primary hippocampal cultures Primary dissociated hippocampal cultures were prepared and maintained as described previously To obtain nominally glia-free cultures, AraC was added 8 to 10 h after plating on DIV 0. A medium change was performed on DIV 8 wherein either 50% of the growth medium was replaced with neurobasal-A medium supplemented with B27 and 0.5 mM glutamine, or the growth medium was completely replaced with medium consisting of a mixture of buffered saline solution (10 mM Hepes, pH 7.4, 114 mM NaCl, 26.1 mM NaHCO 3, 5.3 mM KCl, 1 mM MgCl 2, 2 mM CaCl 2, 30 mM glucose, 1 mM glycine, 0.5 mM C 3 H 3 NaO 3, and 0.001% phenol red) and phosphate-free Eagle's minimum essential medium (Gibco; catalog no.: 21090-022) (9:1 v/v), supplemented with insulin (7.5 g/ml), transferrin (7.5 g/ml), and sodium selenite (7.5 ng/ml) (ITS Liquid Media Supplement; Sigma-Aldrich; catalog no.: I3146) and 50 U/ml penicillin-streptomycin. To obtain nominally neuron-free glial cultures, cells plated at a density of 1.2 10 5 cells/cm 2 were grown in Dulbecco's modified Eagle's medium (Gibco; catalog no.: 41965-039) containing 10% fetal bovine serum (Gibco; catalog no.: 10270) and 50 U/ml penicillin-streptomycin. On DIV 3, the cells were washed two times with ice-cold PBS, and a full medium change was performed. A 50% medium change was performed on DIV 6 and DIV 8, and AraC was added to the medium on DIV 8 to halt glial proliferation. Pharmacology The following pharmacological agents were used: bicuculline rAAVs and plasmids Viral particles were produced and purified as described previously. To drive expression of the mitochondrially targeted FRET-based calcium indicator 4mtD3cpv in excitatory neurons, we used a previously described viral vector containing a CaMK2a promoter. For expression of shRNA, we used an rAAV vector containing the U6 promoter for shRNA expression and the CaMK2a promoter for expression of mCherry to enable the identification of infected excitatory neurons. Two different shRNA sequences against mouse NCLX were generated using iRNAi (Softonic; RRID: SCR_015548), cloned, and tested for silencing efficiency (shNCLX-1, ATGTTGGACTGTGGATCTAAA; shNCLX-2, CGACAAGGACGATCGGAATTG). ShNCLX-1 was selected for most experiments as it provided the most potent knockdown and is also referred to as shNCLX. As a control, we used a sequence with no known targets in the mouse genome (shCTRL, GTGCCAAGACGGGTAGTCA). Unless otherwise stated, rAAV-shCTRL, rAAV-shNCLX-1, and rAAV-shNCLX-2 were used in vitro at a concentration of 7 10 8 viral particles/ml. The viral vector driving expression of the mitochondrial matrix-targeted ratiometric glutathione redox potential indicator, glutaredoxin 1-redox-sensitive GFP roGFP2 (mito-Grx1-roGFP2) under control of a cytomegalovirus/chicken beta-actin hybrid promoter, has been described before. Primary cultures were infected >6 h after addition of AraC on DIV 3 or DIV 4 (mixed cultures and glia-free cultures) or >6 h after the complete medium change on DIV 3 or DIV 4 (glial cultures). The plasmid used to drive expression of EGFP and murine NCLX under the control of a cytomegalovirus/chicken beta-actin hybrid promoter (pAAV-EGFP.T2A.NCLX) was generated using standard cloning techniques using a previously described mouse NCLX overexpression construct. A large portion of the mouse NCLX 3 0 UTR (nucleotides 1908-2681 from NM_133221) was amplified from mouse genomic DNA using the following primers: 5 0 -AGTCCCAAGCTTCTGAAGCTGCTTGGCCTA GAGG-3 0 and 5 0 -ATGCCCAAGCTTGGAGGCAAAGGCA GGCAGATTTC-3 0 and inserted into a HindIII restriction site downstream from the NCLX coding sequence. All plasmids were verified by sequencing. Fluorescence imaging All live imaging experiments were performed in a Hepesbuffered saline (HBS) solution containing, in millimolar: 140 NaCl, 2.5 KCl, 1.0 MgCl 2, 2.0 CaCl 2, 10 Hepes, 1.0 glycine, 35.6 D-glucose, and 0.5 sodium pyruvate. NMDA-induced and gabazine-induced changes in mitochondrial calcium levels, m, and glutathione redox potential were analyzed as described using the FRET-based mitochondrially targeted calcium indicator, 4mtD3cpv, the ratiometric redox potential indicator mito-Grx1-roGFP2, and the small molecule dye, Rh123 (Molecular Probes; catalog no.: R302), respectively. Fluorescence images were acquired from cells bathed in room-temperature HBS at 0.667 to 2.0 Hz with a cooled CCD camera (iXon, Andor or ImagEMX2; Hamamatsu) through a 20 water-immersion objective (XLMPlanFluor, 0.95W; Olympus) on an upright microscope (BX51W1; Olympus). Fluorescence excitation (4mtD3cpv: cyan fluorescent protein 430 ± 12 nm, yellow fluorescent protein 500 ± 10 nm; Rh123: 470 ± 20 nm; mito-Grx1-roGFP2: 405 ± 10 and 470 ± 20 nm; AHF Analysentechnik) was provided by a xenon arc lamp in combination with an excitation filter wheel (cell R ; Olympus). Mito-Grx1-roGFP2 and Rh123 fluorescence was filtered using a 525 ± 25 nm emission filter (AHF Analysentechnik). For 4mtD3cpv imaging, cyan fluorescent protein (470 ± 12 nm) and yellow fluorescent protein (535 ± 15 nm) emission wavelengths were separated and filtered using a DualView beam splitter (AHF Analysentechnik and MAG Biosystems). Data were collected using proprietary software (cell R ; Olympus) and analyzed using Fiji (RRID: SCR_02283) and IgorPro (WaveMetrics; RRID: 000325). Only morphologically intact cells expressing mCherry were chosen for analysis. Cells with disintegrated dendrites or swollen somata were excluded from analysis. Mitochondrial calcium concentration changes in regions of interest (ROIs) drawn around individual neurons were quantified using the crosstalkand bleaching-corrected 4mtD3cpv FRET ratio (R FRET ). For m imaging, primary hippocampal cultures were loaded with Rh123 (4.3 M), a positively charged dye that accumulates inside mitochondria because of their negative intraluminal charge with respect to the cytosol, in HBS for 30 min at room temperature, followed by extensive washing with HBS. When loaded at the concentrations employed in this study, intramitochondrial Rh123 reaches levels that result in selfquenching, such that intramitochondrial Rh123 exhibits less fluorescence that it would were the same amount of dye to be distributed in a markedly larger volume. During m breakdown, Rh123 is released into the cytosol, where-on account of the proportionally much larger volume of this subcellular compartment-self-quenching does not restrict its fluorescence. Since m breakdown-associated Rh123 fluorescence changes originating in mitochondria presumably reflect the combined effects of dequenching and decreased dye load, which would result in increased and decreased fluorescence, respectively, we reasoned that clear signals that reflect a loss of m would be best obtained by measuring cytosolic Rh123 fluorescence. Because of its small molecular size, cytosolic Rh123 can freely diffuse into the nucleus. Accordingly, cytosolic and nuclear Rh123 levels, which are near zero under basal conditions, rise in both compartments upon m breakdown. Thus, intranuclear Rh123 fluorescence increases reliably reflect the m breakdown-associated release of Rh123 from mitochondria. As it is much more straightforward to define mitochondria-free ROIs within the nuclear compartment than within the non-nuclear cytosol, we measured Rh123 fluorescence intensity over time in the nucleus of imaged cells as a readout of depolarizing changes in m. Maximum Rh123 signal was obtained at the conclusion of each experiment by exposing the recorded cells to the mitochondrial uncoupler FCCP. Mean nuclear Rh123 fluorescence intensity was quantified on a cell-by-cell basis as a percent of the FCCP-induced level, with baseline (measured in the last 10 s prior to NMDA/gabazine application) set to 0%. Imaging of mito-Grx1-roGFP2 was either performed as aforementioned or at the Nikon Imaging Center (Heidelberg University) using an automated inverted Nikon Ti microscope equipped with a Nikon Plan Fluor 20/0.75 multi-immersion objective (water immersion was used), a Yokagawa CSU-X1 confocal scanning unit, a Hamamatsu C9100-02 EMCCD camera and a TokaiHit on-stage incubation system. Mito-Grx1-roGFP2 was sequentially excited every 20 s using 405 and 488 nm laser lines, and emission (527 ± 27.5 nm) was collected for both excitation wavelengths. For all confocal imaging experiments, imaging was performed at 37 C and ambient CO 2 levels. Maximum roGFP2 signal was obtained by exposing the cells to the thioloxidizing reagent diamide. Glutathione redox potential in ROIs drawn around individual neurons was quantified using the 405/488 emission ratio, R, and normalized to the diamideinduced maximum of this ratio, R max : R/R max. The NMDA response was quantified as the amplitude 10 min after NMDA application using the baseline-subtracted R/R max ratio: R/ R max − R/R max (baseline), where R/R max (baseline) was measured in the last 10 s prior to NMDA application. ACCTGGTGAACTACGACTGCTAGA; reverse: TGCTTGATTTAGTCGGCCTGGGAT), mt-Co1 (forward: CTCGCCTAATTTATTCCACTTCA; reverse: GGGGCTAGG GGTAGGGTTAT); mt-Co2 (forward: CAGTCCCCTCCC TAGGACTT; reverse: TCAGAGCATTGGCCATAGAA); and mt-Nd1 (forward: GGGATAACAGCGCAATCCTA; reverse: ATCGTTGAACAAACGAACCA). Expression levels of target genes evaluated using TaqMan reagents were normalized to the expression of the housekeeping gene, glucoronidase, beta (GusB) (Mm00446953_m1); expression levels of genes evaluated using Power SYBR Green reagent were normalized to the expression of actin beta (Actb) (forward: CTAAGGC-CAACCGTGAAAAG; reverse: ACCAGAGGCATA-CAGGGACA). For each independent experiment or set of experiments, basal expression of the untreated rAAV-shCTRLinfected control was set to 100%, and the remaining conditions normalized accordingly. Immunocytochemistry and cell death analysis Cells grown in 4-well or 24-well plates were fixed using Roti-Histofix 4% (Carl Roth; catalog no.: P087) or 4% paraformaldehyde plus 4% sucrose in PBS for 15 min at room temperature and then washed with PBS. When antibody staining was performed, cells were then permeabilized with methanol at −20 C, blocked using 10% normal goat serum in PBS, and incubated in mouse anti-GFAP antibody diluted 1:500 in 2% bovine serum albumin plus 0.1% Triton X-100 in PBS overnight at 4 C. The cells were then incubated in 1:500 Dylight488-conjugated donkey antimouse secondary antibody for 1 h at room temperature and mounted in Mowiol 4-88 medium containing 2 g/ml Hoechst 33258 as a nuclear counterstain. When antibody staining was not performed, cells were mounted after fixation and PBS washes with Mowiol 4-88 containing Hoechst 33258. For robust quantification of glial cells and nuclei, 16 to 20 evenly distributed fields of view were examined per condition and preparation. Images were obtained using a Leica DMIRBE inverted microscope equipped with a 10/0.3 objective and a SPOT Insight 14 bit CCD camera (Visitron Systems) or a 16 bit Neo sCMOS camera (Andor Technologies) with VisiView imaging software (Visitron Systems) or using a Ti2 Eclipse inverted microscope (Nikon) equipped with a Sola SE II Light Engine (Lumencor), an S Plan Fluor 20/0.45 objective (Nikon), and a DS-Qi2 14 bit CCD camera (Nikon) with NIS-Elements imaging software (Nikon; RRID: SCR_014329) at the Nikon Imaging Center at Heidelberg University. Counts of GFAP-positive cells were obtained manually for each field of view. Nuclei were identified using custom pipelines in CellProfiler Image Analysis Software (CellProfiler; RRID: SCR_007358). Dead cells, which were characterized by their amorphous or shrunken nuclei as described previously, were quantified semiautomatically using CellProfiler Analyst (CellProfiler; RRID: SCR_010649). All conditions for each preparation were analyzed in parallel. The probability of a cell surviving any given treatment can be expressed as the product of the probability that it might survive under basal conditions with the probability that it might survive the treatment: P survival = (1 − P basal ) (1 − P treatment ), where P survival is the probability of a cell surviving following a given treatment, P basal is probability of a cell dying in the absence of any treatment, and P treatment is the probability of a cell dying specifically because of the treatment administered. To determine whether NCLX knockdown specifically rendered cultured cells more vulnerable to treatments, we solved the aforementioned equation for P treatment. For NMDA toxicity experiments, medium was exchanged on DIV 10 with pre-equilibrated medium containing 0, 5, 10, or 20 M NMDA. Cells were returned to the incubator for 10 min and then washed three times with fresh and equilibrated medium before being returned to the incubator for another 16 to 24 h prior to fixation. The same procedure was followed for experiments involving stimulation with 50 M bicuculline for 20 min or 24 h. Mice and stereotactic surgery We used four female C57BL/6NCrl mice (Charles River Laboratories; RRID: IMSR_CRL:27) from 5 to 9 weeks of age. One mouse was excluded from the analysis because the hippocampus was badly damaged during cryoslicing. The mice were group-housed on a 12 h light/dark cycle with food and water ad libitum. All procedures were performed according to the German guidelines for the care and use of laboratory animals and with the European Community Council Directive 86/609/EEC and were approved by local authorities. rAAVs were injected into the dorsal hippocampus using the following coordinates relative to bregma (two injection sites per hemisphere): −2.1 mm anteroposterior, ±1.5 mm mediolateral, −1.4 and −1.6 mm dorsoventral; −2.6 mm anteroposterior, ±2.5 mm mediolateral, and −1.9 and −2.1 mm dorsoventral. A total volume of 2 l of a 2:1 PBS:20% mannitol solution containing 1 10 12 rAAV particles per ml was injected into each hemisphere. The injection speed was 200 nl/ min through a 33 Ga needle. The needle was left for 60 or 120 s at each injection site to allow the fluid to diffuse prior to moving or withdrawing the needle, respectively. Immunohistochemistry and FJC staining Four weeks following stereotactic surgeries, mice were anesthetized with an overdose of pentobarbital (300 mg/kg) and then perfused briefly with PBS followed by 4% paraformaldehyde in PBS, pH 7.4, to fix the tissue. Brains were removed and post-fixed in the same solution overnight and then placed into a PBS containing 0.04% thimerosal (Sigma-Aldrich) to prevent contamination and 30% sucrose for cryoprotection. Brain sections (20 m) were mounted directly onto Superfrost Plus Slides (Thermo Fisher Scientific; catalog no.: J1800AMNZ) and stored at −20 C until further processing. For immunostaining, slices on slides were permeabilized and blocked in antibody solution consisting of 1:9 normal goat serum and buffer containing 0.2% gelatin, 33 mM Na 2 HPO 4, 0.6% Triton X-100, and 0.9 M NaCl for 90 min at room temperature. Slices were incubated with mouse anti-GFAP antibody (Cell Signaling Technology; catalog no.: 3670; RRID: AB_561049) diluted 1:300 in antibody solution for 3 days at 4 C, and then in 1:500 Dylight488-conjugated donkey anti-mouse secondary antibody (Dianova; catalog no.: 715-485-150; RRID: AB_2687442) for 90 min at room temperature. To reduce background fluorescence, slices were finally incubated in 0.1% Sudan Black B (Acros Organics; catalog no.: 4197-25-5) in 70% ethanol for 20 min at room temperature. Slides were mounted in Mowiol 4-88 (Calbiochem; catalog no.: 475904) medium containing 2 g/ml Hoechst 33258 (Serva; catalog no.: 15090) as a nuclear counterstain. For FJC staining, slices on slides were dehydrated in 80% ethanol containing 1% NaOH for 5 min, washed, and then incubated in 0.06% KMnO 4 for 15 min to reduce background followed by 0.0002% FJC (Histo-Chem, Inc; catalog no.: 2FJC) in 1% acetic acid for 30 min. Slices were then washed with water and allowed to dry overnight. They were finally dehydrated in xylene and mounted using Roti-Histokitt II (Carl Roth; catalog no.: T160). Images were obtained with NIS-Elements imaging software (RRID: SCR_014329) at the Nikon Imaging Center at the Heidelberg University using a Ni Eclipse upright microscope equipped with a 10/0.45 Plan Apo objective and a DS-Qi2 14 bit CCD camera (all Nikon) or using a Leica DMIRBE inverted microscope equipped with a 10/0.3 objective a 16 bit Neo sCMOS camera (Andor Technologies) with VisiView imaging software (Visitron Systems), and stitched together using the automated Photomerge function of Adobe Photoshop. FJC and GFAP signals were quantified with Fiji software (RRID: SCR_002285). Threshold level was determined from the rAAV-shCTRL-infected hemisphere and set as the mean +3 SD from manually drawn ROIs. For FJC analysis, ROIs encompassed the entire mCherry + dorsal CA1 stratum pyramidale in each hemisphere. For GFAP analysis, ROIs were drawn within FJC + areas of stratum radiatum in the rAAV-shNCLX-infected hemisphere and mirrored (with minor adjustments) onto to the rAAV-shCTRL-infected hemisphere. Particles were defined as suprathreshold areas exceeding 50 pixels in size. The total area of FJC + or GFAP + particles was obtained from three to four sections for each animal. Experimental design and statistical analysis Statistical analyses were carried out and graphs generated using GraphPad Prism (GraphPad Software, Inc; RRID: SCR_002798). Bar graphs show the mean + SEM. Violin plots show the probability density of the data as well as median and quartile divisions. Outliers were identified using the ROUT method with Q = 1%, and data were assessed for normality using the Shapiro-Wilk test. The following statistical tests were used as indicated in the text and figure legends: twotailed one-sample t test versus a hypothetical value of 1, Kruskal-Wallis test followed by Dunn's multiple comparisons test, two-tailed paired-samples t test, two-tailed independentsamples t test, two-tailed independent-samples Mann-Whitney test, mixed-effects model one-way ANOVA followed by Dunnett's multiple comparisons test, mixed-effects model one-way ANOVA followed by Sidk's multiple comparisons test, ordinary one-way ANOVA followed by Sdk's multiple comparisons test, ordinary two-way ANOVA followed by Tukey's multiple comparisons test, ordinary two-way ANOVA followed by Sdk's multiple comparisons test, repeated-measures two-way ANOVA followed by Tukey's multiple comparisons test, repeated-measures two-way ANOVA followed by Sdk's multiple comparisons test, mixed-effects model two-way ANOVA followed by Tukey's multiple comparisons test, and mixed-effects model two-way ANOVA followed by Sdk's multiple comparisons test. Precise p values are provided in the text or figure legends, as appropriate, and significance levels are indicated on figures as follows: not significant (ns), *p < 0.05, **p < 0.01, ***p < 0.001, and ****p < 0.0001. Data availability All data generated during the experimental procedures in this article are contained within the article and/or are available on request. Supporting information-This article contains supporting information.
<reponame>gabrieljaegerde/substrateGo_telegram<filename>src/models/wallet.ts import mongoose from "mongoose"; import { amountToHuman, bigNumberArithmetic } from "../../tools/utils.js"; import randomNumber from "random-number-csprng"; import { botParams } from "../../config.js"; export interface IWallet { address: string; balance: string; linked: boolean; password: string; passwordExpiry: Date; getAccountDetails(): string; setPassword(); passwordExpired(); } const Schema = mongoose.Schema; export const WalletSchema = new Schema( { address: { type: String, required: true }, balance: { type: String, default: "0" }, linked: { type: Boolean, default: false }, password: { type: String, required: false }, passwordExpiry: { type: Date, required: false } }, { timestamps: true } ); WalletSchema.methods.getAccountDetails = async function (this: IWallet) { const { value, tokenString } = await amountToHuman(this.balance); return `Address: ${this.address}\n\nBalance: ${value} ${tokenString}`; }; WalletSchema.methods.setPassword = async function (this: IWallet) { const now = new Date(); const quarterAfter = new Date(now.getTime() + (15 * 60 * 1000)); const code = await randomNumber(botParams.settings.pwordLower, botParams.settings.pwordUpper); this.password = bigNumberArithmetic(code, "1e" + botParams.settings.pwordDigitsToAdd, "*"); this.passwordExpiry = quarterAfter; }; WalletSchema.methods.passwordExpired = function (this: IWallet) { return this.passwordExpiry < new Date(); }; export default mongoose.model<IWallet>('wallet', WalletSchema);
# # (C) Copyright IBM Corp. 2020 # # 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. # from lithops.executors import FunctionExecutor from lithops.executors import LocalhostExecutor from lithops.executors import ServerlessExecutor from lithops.executors import StandaloneExecutor from lithops.version import __version__ name = "lithops" def ibm_cf_executor(config=None, runtime=None, runtime_memory=None, workers=None, storage_backend=None, rabbitmq_monitor=None, remote_invoker=None, log_level=None): """ Function executor for IBM Cloud Functions """ compute_backend = 'ibm_cf' return ServerlessExecutor( config=config, runtime=runtime, runtime_memory=runtime_memory, workers=workers, backend=compute_backend, storage=storage_backend, rabbitmq_monitor=rabbitmq_monitor, remote_invoker=remote_invoker, log_level=log_level ) def knative_executor(config=None, runtime=None, runtime_memory=None, workers=None, storage_backend=None, rabbitmq_monitor=None, remote_invoker=None, log_level=None): """ Function executor for Knative """ compute_backend = 'knative' return ServerlessExecutor( config=config, runtime=runtime, runtime_memory=runtime_memory, workers=workers, backend=compute_backend, storage=storage_backend, rabbitmq_monitor=rabbitmq_monitor, remote_invoker=remote_invoker, log_level=log_level ) def function_executor(type=None, config=None, backend=None, storage=None, runtime=None, runtime_memory=None, workers=None, rabbitmq_monitor=None, remote_invoker=None, log_level=None): """ Generic function executor """ return FunctionExecutor( type=type, config=config, runtime=runtime, runtime_memory=runtime_memory, workers=workers, backend=backend, storage=storage, rabbitmq_monitor=rabbitmq_monitor, remote_invoker=remote_invoker, log_level=log_level ) def local_executor(config=None, workers=None, storage_backend=None, rabbitmq_monitor=None, log_level=None): """ Localhost function executor """ return LocalhostExecutor( config=config, workers=workers, storage=storage_backend, rabbitmq_monitor=rabbitmq_monitor, log_level=log_level ) def code_engine_executor(config=None, runtime=None, runtime_memory=None, workers=None, storage_backend=None, rabbitmq_monitor=None, log_level=None): """ Function executor for Code Engine """ compute_backend = 'code_engine' return ServerlessExecutor( config=config, runtime=runtime, runtime_memory=runtime_memory, workers=workers, backend=compute_backend, storage=storage_backend, rabbitmq_monitor=rabbitmq_monitor, remote_invoker=True, log_level=log_level )
<filename>ctseq/addumis.py import os import sys import glob from . import utilities def run(args): dir=args.dir # directory containing the fastq files. Unless otherwise specified, the default is the current directory. runType=args.umiType # 'separate' if the UMIs are contained in a separate fastq file.'inline' if UMIs are already included in the forward and reverse read fastq files. umiLength=int(args.umiLength) # Length of the UMI sequence forwardExt=args.forwardExt # Extension of the fastq file containing forward reads. Include .gz if files are compressed. reverseExt=args.reverseExt # Extension of the fastq file containing reverse reads. Include .gz if files are compressed. umiExt=args.umiExt # Extension of the fastq file containing UMIs. Include .gz if files are compressed. Required if UMIs are in a separate fastq file from forward and reverse reads. # if dir[-1]!='/': # dir+='/' ############################################## # arg check - make sure this is a valid path # # Makes sure all the files needed are in your current directory ############################################## print('\n**************') print('ADDING UMIs',utilities.getDate()) print('**************\n') dir=utilities.validDir(dir) utilities.fileCheck(dir,forwardExt) utilities.fileCheck(dir,reverseExt) os.chdir(dir) if runType=='separate' and umiExt=='NOTSPECIFIED': print('\n**ERROR**') print('Since your UMIs are in separate fastq files, please specify the unique file extension of the UMI fastq files for the \'--umiExt\' flag (e.g. R2_001.fastq OR R2_001.fastq.gz)') print('**EXITING**') sys.exit() elif runType=='inline' and umiExt!='NOTSPECIFIED': print('\n**ERROR**') print('You specified that the UMIs are \'inline\' for the \'--type\' flag yet you also used the \'--umiExt\' flag implying you have separate file with UMIs in it. Did you mean to use \'separate\' with the \'type\' flag instead?') print('**EXITING**') sys.exit() elif runType=='separate' and umiExt!='NOTSPECIFIED': utilities.fileCheck(dir,umiExt) ############################# # continue with adding umis # ############################# allForwardFiles=utilities.naturalSort(glob.glob('*'+forwardExt)) for forwardFileName in allForwardFiles: sampleName=forwardFileName.split("_")[0] reverseFileName=glob.glob(sampleName+'_*'+reverseExt)[0] # unzip forward/reverse files if needed forwardFileName=decompressFile(forwardFileName) reverseFileName=decompressFile(reverseFileName) print('****') if runType=='separate': # if the UMIs are separate from the forward and reverse reads umiFileName=glob.glob(sampleName+'_*'+umiExt)[0] umiFileName=decompressFile(umiFileName) # make dictionary of umis umiDict={} with open(umiFileName,"r") as umiFile: umiData=umiFile.readlines() for i in range(0,len(umiData),1): if i % 4 == 0: line=umiData[i] readName=line.strip("\n").split(" ")[0] umi=umiData[i+1].strip("\n")[:umiLength] # grab the specified length of umi umiDict[readName]=umi # add UMIs to forward and reverse file print('adding UMIs to fastq file with forward reads for',forwardFileName,utilities.getDate()) addUMIs_separate(myUMIdict=umiDict,myFastqFileName=forwardFileName,myBaseName='forward') print('adding UMIs to fastq file with reverse reads for',reverseFileName,utilities.getDate()) addUMIs_separate(myUMIdict=umiDict,myFastqFileName=reverseFileName,myBaseName='reverse') print('compressing UMI file for sample',sampleName,utilities.getDate()) os.system('pigz '+umiFileName) elif runType=='inline': # if UMIs are already included in the forward and reverse read fastq files print('adding inline UMIs to forward reads for',forwardFileName,utilities.getDate()) addUMIs_inline(myFastqFileName=forwardFileName,myBaseName='forward',myUMIlength=umiLength) print('adding inline UMIs to reverse reads for',reverseFileName,utilities.getDate()) addUMIs_inline(myFastqFileName=reverseFileName,myBaseName='reverse',myUMIlength=umiLength) # compress input files print('compressing forward file for sample',sampleName,utilities.getDate()) os.system('pigz '+forwardFileName) print('compressing reverse file for sample',sampleName,utilities.getDate()) os.system('pigz '+reverseFileName) print('') print('\n**************') print('DONE ADDING UMIs',utilities.getDate()) print('**************\n') def addUMIs_separate(myUMIdict,myFastqFileName,myBaseName): sampleName=myFastqFileName.split('_')[0] outputFileName=sampleName+'_'+myBaseName+'ReadsWithUMIs.fastq' # add umis to data file with open(myFastqFileName, 'r') as fastqFile: with open(outputFileName,'w') as outFile: lineNumber=0 for line in fastqFile: if lineNumber % 4 ==0: line = line.strip('\n').split(' ') myReadName=line[0] sampleBarcode=line[1].split(':')[-1] # just grabbing the sample umi 3:N:0:CGTGTAAT line=myReadName+'-'+sampleBarcode+'+'+myUMIdict[myReadName]+'\n' outFile.write(line) lineNumber+=1 def addUMIs_inline(myFastqFileName,myBaseName,myUMIlength): sampleName=myFastqFileName.split('_')[0] outputFileName=sampleName+'_'+myBaseName+'ReadsWithUMIs.fastq' with open(myFastqFileName, 'r') as dataFile: with open(outputFileName,'w') as outFile: lineNumber=0 for line in dataFile: if lineNumber % 4 ==0: line = line.strip('\n').split(' ') umi=line[0].split(':')[-1] # grabbing the UMI umi=umi[:myUMIlength] # make sure UMI is correct length myReadName=':'.join(line[0].split(':')[:-1]) # grabbing read name minus the UMI sampleBarcode=line[1].split(':')[-1] # just grabbing the sample barcode 3:N:0:CGTGTAAT line=myReadName+'-'+sampleBarcode+'+'+umi+'\n' outFile.write(line) lineNumber+=1 # this fxn decompresses file if file ends in '.gz' def decompressFile(fileName): if fileName[-3:]=='.gz': os.system('pigz -d '+fileName) fileName=fileName[:-3] return(fileName)
Join us for Boston Homegrown Part 2, the second in our meetup series featuring virtual realities created right here in Boston! This time we'll feature two more local companies doing great work in VR. As usual we'll also have lots of VR demos for you to experience, including some new ones. When you RSVP please read the section labelled "important" for details on reserving your spot. The Genji Glove is a wearable input device that lends itself especially well to virtual reality, sporting a few fabric-buttons and a joystick, the gloves can be a drop-in replacement for a traditional controller. However, with very detailed sensors for fine-motor control, gesture recognition, and EMG (muscle sensors) the Genji Glove can be applied in ways that vision systems and controllers can't provide. It's fast and accurate enough to translate American Sign Language in real time. It takes less than 2 minutes to train new gestures. It supports full avateering and it can feel the effort you put into your actions like nothing else. And it's made right here in Boston! Myo Studios (http://myostudios.com), a small creative content start-up located in Brookline, hot off the heels of their first project working with the Boston Society of Architects, will be undertaking their most ambitious project to date; capturing real world cuisine for the VR world! Currently underdevelopment, 'Perception Fixe' (tentative title) is being touted as the first ever VR food blog, featuring real dishes from Boston and its surrounding areas. Through magic of photogrammetry (a method of developing 3D models from photography) Oculus Rift users will be invited to sit down and experience the best that Boston has to offer, from local greasy spoon burgers to haute cuisine. It's sure to be a mouth watering experience! IMPORTANT: Our venue, the Venture Cafe at the Cambridge Innovation Center, requires us to provide a guest list so people can check in at the security desk to get their access cards. Please bring a photo ID for check-in at the security desk. Your meetup.com account name must match the name on your ID; if you'd prefer not to use your real name please contact co-organizer Jeffrey Jacobson via private message so he can add you to the list. Schedule 6 - Doors open, demos begin, pizza is served thanks to Genji Glove! 7 - 7:30 - Myo Studios Presentation 7:30 - 8 Genji Glove Presentation 8 - 8:15 - Demo intros & announcements 8:15 - 9:45 Demofest!! 9:45pm - Come with us to the afterparty at Firebrand Saints (http://firebrandsaints.com) (it's right downstairs!!) Parking If you're coming to the afterparty, Firebrand Saints (http://firebrandsaints.com) offers free validated parking for entry after 5pm. Free parking after 5pm in the MIT Hayward Lot (http://web.mit.edu/mitdlbc/www/parking.htm).
Christopher Columbus and Culicoides: was C. jamaicensis Edwards, 1922 introduced into the Mediterranean 500 years ago and later re-named C. paolae Boorman 1996? The biting midge, Culicoides paolae Boorman, described from specimens collected in the extreme south of Italy in 1996, belongs in the subgenus Drymodesmyia. This subgenus was erected by Vargas in 1960 for the so-called Copiosus species group, an assemblage of 22 species endemic to the tropical regions of the New World and, where known, breed in vegetative materials including the decaying leaves (cladodes) and fruits of Central American cacti. The Mexican peoples have utilised these cacti for over 9,000 years; one of these, Opuntia ficus-indica Linnaeus, was brought to Europe by Christopher Columbus following his voyages of discovery. As a taxon C. paolae is very similar to the Central American C. jamaicensis Edwards, 1922 raising the possibility that it (or a closely related species of Drymodesmyia) was introduced into the Mediterranean Region at the time of Columbus, but was (perplexingly) discovered only 500 years later and named C. paolae. The comparison of Sardinian specimens of C. paolae with Panamanian material of C. jamaicensis (housed in the Natural History Museum in London) confirmed the two species to be very similar but unusual differences were noted around the precise distribution of the sensilla coeloconica on the female flagellum. Until it is understood whether these differences represent either intra- or interspecific variation, the question of the possible synonymy of C. paolae must be held in abeyance.
<gh_stars>100-1000 #include <errno.h> #include <nan.h> #include <sys/ioctl.h> #include <linux/spi/spidev.h> #include "spidevice.h" #include "transfer.h" #include "util.h" static int Transfer( int fd, spi_ioc_transfer *spiTransfers, uint32_t transferCount ) { int totalLen = 0; for (uint32_t i = 0; i != transferCount; ++i) { totalLen += spiTransfers[i].len; } int ret = ioctl(fd, SPI_IOC_MESSAGE(transferCount), spiTransfers); if (ret != -1 && ret != totalLen) { errno = EINVAL; ret = -1; } return ret; } class TransferWorker : public SpiAsyncWorker { public: TransferWorker( Nan::Callback *callback, int fd, v8::Local<v8::Array> &message, spi_ioc_transfer *spiTransfers, uint32_t transferCount ) : SpiAsyncWorker(callback), fd_(fd), spiTransfers_(spiTransfers), transferCount_(transferCount) { SaveToPersistent("message", message); } ~TransferWorker() { } void Execute() { int ret = Transfer(fd_, spiTransfers_, transferCount_); free(spiTransfers_); if (ret == -1) { SetErrorNo(errno); SetErrorSyscall("transfer"); } } void HandleOKCallback() { Nan::HandleScope scope; v8::Local<v8::Value> message = GetFromPersistent("message"); v8::Local<v8::Value> argv[] = { Nan::Null(), message }; callback->Call(2, argv, async_resource); } private: int fd_; spi_ioc_transfer *spiTransfers_; uint32_t transferCount_; }; static int32_t ToSpiTransfers( v8::Local<v8::Array> &message, spi_ioc_transfer *spiTransfers ) { for (unsigned i = 0; i < message->Length(); ++i) { // Transfer v8::Local<v8::Value> transfer = Nan::Get(message, i).ToLocalChecked(); if (!transfer->IsObject()) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "a transfer must be an object" ) ); return -1; } v8::Local<v8::Object> msg = v8::Local<v8::Object>::Cast(transfer); // byteLength v8::Local<v8::Value> byteLength = Nan::Get(msg, Nan::New<v8::String>("byteLength").ToLocalChecked()). ToLocalChecked(); if (byteLength->IsUndefined()) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer byteLength not specified" ) ); return -1; } else if (!byteLength->IsUint32()) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer byteLength must be an unsigned integer" ) ); return -1; } uint32_t length = Nan::To<uint32_t>(byteLength).FromJust(); spiTransfers[i].len = length; // sendBuffer v8::Local<v8::Value> sendBuffer = Nan::Get(msg, Nan::New<v8::String>("sendBuffer").ToLocalChecked()). ToLocalChecked(); if (sendBuffer->IsNull() || sendBuffer->IsUndefined()) { // No sendBuffer so tx_buf must be NULL. This is already the case. } else if (node::Buffer::HasInstance(sendBuffer)) { if (node::Buffer::Length(sendBuffer) < length) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer sendBuffer contains less than byteLength bytes" ) ); return -1; } spiTransfers[i].tx_buf = (__u64) node::Buffer::Data(sendBuffer); } else { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer sendBuffer must be null, undefined, or a Buffer object" ) ); return -1; } // receiveBuffer v8::Local<v8::Value> receiveBuffer = Nan::Get(msg, Nan::New<v8::String>("receiveBuffer").ToLocalChecked()). ToLocalChecked(); if (receiveBuffer->IsNull() || receiveBuffer->IsUndefined()) { // No receiveBuffer so rx_buf must be NULL. This is already the case. } else if (node::Buffer::HasInstance(receiveBuffer)) { if (node::Buffer::Length(receiveBuffer) < length) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer receiveBuffer contains less than byteLength bytes" ) ); return -1; } spiTransfers[i].rx_buf = (__u64) node::Buffer::Data(receiveBuffer); } else { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer receiveBuffer must be null, undefined, or a Buffer object" ) ); return -1; } // sendBuffer and receiveBuffer if ((sendBuffer->IsNull() || sendBuffer->IsUndefined()) && (receiveBuffer->IsNull() || receiveBuffer->IsUndefined())) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer contains neither a sendBuffer nor a receiveBuffer" ) ); return -1; } // speedHz v8::Local<v8::Value> speedHz = Nan::Get(msg, Nan::New<v8::String>("speedHz").ToLocalChecked()).ToLocalChecked(); if (speedHz->IsUndefined()) { // No speedHz defined, nothing to do. } else if (!speedHz->IsUint32()) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer speedHz must be an unsigned integer" ) ); return -1; } else { spiTransfers[i].speed_hz = Nan::To<uint32_t>(speedHz).FromJust(); } // microSecondDelay v8::Local<v8::Value> microSecondDelay = Nan::Get(msg, Nan::New<v8::String>("microSecondDelay").ToLocalChecked()).ToLocalChecked(); if (microSecondDelay->IsUndefined()) { // No microSecondDelay defined, nothing to do. } else if (!microSecondDelay->IsUint32()) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer microSecondDelay must be an unsigned integer" ) ); return -1; } else { uint32_t delay = Nan::To<uint32_t>(microSecondDelay).FromJust(); if (delay >= 65536) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer microSecondDelay must be less than 65536" ) ); return -1; } spiTransfers[i].delay_usecs = delay; } // bitsPerWord v8::Local<v8::Value> bitsPerWord = Nan::Get(msg, Nan::New<v8::String>("bitsPerWord").ToLocalChecked()).ToLocalChecked(); if (bitsPerWord->IsUndefined()) { // No bitsPerWord defined, nothing to do. } else if (!bitsPerWord->IsUint32()) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer bitsPerWord must be an unsigned integer" ) ); return -1; } else { uint32_t bits = Nan::To<uint32_t>(bitsPerWord).FromJust(); if (bits >= 256) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer bitsPerWord must be less than 256" ) ); return -1; } spiTransfers[i].bits_per_word = bits; } // chipSelectChange v8::Local<v8::Value> chipSelectChange = Nan::Get(msg, Nan::New<v8::String>("chipSelectChange").ToLocalChecked()). ToLocalChecked(); if (chipSelectChange->IsUndefined()) { // No chipSelectChange defined, nothing to do. } else if (!chipSelectChange->IsBoolean()) { Nan::ThrowError( Nan::ErrnoException( EINVAL, "toSpiTransfers", "transfer chipSelectChange must be a boolean" ) ); return -1; } else { spiTransfers[i].cs_change = Nan::To<bool>(chipSelectChange).FromJust() ? 1 : 0; } } return 0; } void Transfer(Nan::NAN_METHOD_ARGS_TYPE info) { SpiDevice *device = Nan::ObjectWrap::Unwrap<SpiDevice>(info.This()); int fd = device->Fd(); if (fd == -1) { return Nan::ThrowError( Nan::ErrnoException( EPERM, "transfer", "device closed, operation not permitted" ) ); } if (info.Length() < 2 || !info[0]->IsArray() || !info[1]->IsFunction()) { return Nan::ThrowError( Nan::ErrnoException( EINVAL, "transfer", "incorrect arguments passed to transfer(message, cb)" ) ); } v8::Local<v8::Array> message = info[0].As<v8::Array>(); Nan::Callback *callback = new Nan::Callback(info[1].As<v8::Function>()); spi_ioc_transfer *spiTransfers = (spi_ioc_transfer *) malloc(message->Length() * sizeof(spi_ioc_transfer)); memset(spiTransfers, 0, message->Length() * sizeof(spi_ioc_transfer)); if (ToSpiTransfers(message, spiTransfers) == -1) { free(spiTransfers); return; } Nan::AsyncQueueWorker(new TransferWorker( callback, fd, message, spiTransfers, message->Length() )); info.GetReturnValue().Set(info.This()); } void TransferSync(Nan::NAN_METHOD_ARGS_TYPE info) { SpiDevice *device = Nan::ObjectWrap::Unwrap<SpiDevice>(info.This()); int fd = device->Fd(); if (fd == -1) { return Nan::ThrowError( Nan::ErrnoException( EPERM, "transferSync", "device closed, operation not permitted" ) ); } if (info.Length() < 1 || !info[0]->IsArray()) { return Nan::ThrowError( Nan::ErrnoException( EINVAL, "transfer", "incorrect arguments passed to transferSync(message)" ) ); } v8::Local<v8::Array> message = info[0].As<v8::Array>(); spi_ioc_transfer *spiTransfers = (spi_ioc_transfer *) malloc(message->Length() * sizeof(spi_ioc_transfer)); memset(spiTransfers, 0, message->Length() * sizeof(spi_ioc_transfer)); if (ToSpiTransfers(message, spiTransfers) == 0) { if (Transfer(fd, spiTransfers, message->Length()) == -1) { Nan::ThrowError(Nan::ErrnoException(errno, "transferSync", "")); } } free(spiTransfers); info.GetReturnValue().Set(info.This()); }
The current industry standard in satellite latch valves calls for the use of solenoids and magnets to hold the valve in either the open or closed position. The use of solenoids and magnets presents a number of inherent problems in satellite applications. One problem is the large amount of power required and consumed to overpower the latching mechanism and reverse the position of the valve. Such large power consumption is especially undesirable in satellite applications, because electrical power is limited. Another problem associated with latch valves that use solenoids and magnets is the magnetic field output of the latch valve due to possible effects of the satellite operation. In addition, a permanent magnet is typically used in solenoid valves to allow these devices to open and close and remain in a desired set position. A permanent magnet is undesirable in satellite applications because satellite guidance systems use magnetic sensors to determine the position of the satellite. The relatively large problematic magnetic fields produced by the use of the latch valve(s) must be accounted for when calibrating the guidance systems of the satellite. Thus, there is a need for an apparatus that overcomes the above-described problems associated with the use of servo latch valves that have solenoids and magnets.
Surgical devices generally include, but are not limited to, clamps, scissors, forceps, dissectors, and retractors. Typically, such surgical devices consist of three elements: a handle, tissue engaging means, and a member extending between the handle and the tissue engaging means. The handle opens and closes the jaws of the tissue engaging means and often has a locking mechanism to hold the jaws closed. The jaws of the tissue engaging means vary extensively in configuration, length, angle, and delicacy depending upon the function of the device and the tissue being engaged. There are many variations of the member provided between the handle and the tissue engaging means. Such members have been provided in a large number of lengths, bends, and angles in order to allow the surgeon to place the jaws in a large number of locations in a wide variety of human body shapes and sizes. Traditionally, surgeries have been quite invasive to the patient's body, often involving large open incisions. Such surgeries result in great trauma to the patients and require long periods of recovery time. Because these surgeries often involve large incisions, there has not been a strong need for providing surgical devices of a size and detail appropriate for a limited work area. In addition, in order to provide surgeons with a number of choices, surgical devices of various shapes have been provided. In the recent past, minimally-invasive surgery (MIS) has grown in popularity as an alternative to traditional, large incision surgery. The term MIS refers to performing surgery in smaller incisions in order to reduce the trauma experienced by the patient, increase the speed of healing, and reduce the recovery time. For the patient, this ultimately equates to less time in the hospital which adds to the cost effectiveness of these procedures. Understandably, it is very challenging for surgeons to perform surgical tasks in small, MIS incisions. The normal concerns of surgery are compounded with the unique problems brought about by MIS procedures. For example, since the objectives of open surgeries and MIS surgeries are often the same, the occluding of body conduits is still of concern. However, surgical devices of the past were designed for occluding of body conduits during open surgery wherein the size of the surgical device was not constrained by narrow diameters of small, MIS incisions. Thus, such surgical devices, which are necessary in most all procedures, protrude out of the MIS incision and have the potential to interfere with the surgeons' hands as they try to visualize, cut, dissect or suture within the incision. Additionally, in the area of non-minimally invasive surgery, the use of instruments has increased as the surgery technique, have become more and more complex. Thus, it would be advantageous to have a surgical device which minimizes the degree to which it potentially interferes with the surgeon during any surgery, thereby allowing the surgeon to perform more efficient surgery. It would be further advantageous to have a surgical device that allows proper positioning to predetermined body locations within the small incisions.
// reads input flags and interprets the complex ones func init() { runtime.GOMAXPROCS(runtime.NumCPU()) log.SetOutput(os.Stdout) flag.Parse() if *showUsage { flag.Usage() os.Exit(0) } printParams() var err error Client, err = as.NewClient(*Host, *Port) if err != nil { PanicOnError(err) } }
<reponame>joaovmalheiros/Exercicios-Para-Revisao-Cplusplus #include <iostream> using namespace std; //Virtual member: is a member function that can be redefined in a derived class, while preserving its calling properties //trough references. The syntax for a function to become virtual is to precede its declaration with the virtual keyword: class Polygon { protected: int width, height; public: void set_values(int a, int b){width = a; height = b;} virtual int area(){return 0;} }; class Rectangle : public Polygon{ public: int area(){return width * height;} }; class Triangle : public Polygon { public: int area(){width * height / 2;} }; int main() { Rectangle rect; Triangle trgl; Polygon poly; Polygon * ppoly1 = &rect; Polygon * ppoly2 = &trgl; Polygon * ppoly3 = &poly; cout << ppoly1->area() << '\n'; cout << ppoly2->area() << '\n'; cout << ppoly3->area() << '\n'; return 0; } //Non-virtual members can also be redefined in derived classes, but non-virtual members of derived classes cannot //be accessed through a reference of the base class. If virtual is removed from the declaration area, all three //calls to area would return zero, because in all cases, the version of the base class would have been called instead. //What the virtual keyword does is to allow a member of derived class with the same name as one in the base class to //be appropriately called from a pointer, and more precisely, when the type of the pointer is a pointer to the base //class that is pointing to an object of the derive class. //A class that declares or inherits a virtual function is called a polymorphic class.
Growing your organization’s brand awareness can help you further expand your business. But even the most creative of communications professionals can find it quite challenging to continually come up with new and innovative ideas that resonate with your customer base. Members share a few ways you can improve brand awareness. My team and I set up events and meetings to bring realtors into our offices. I then teach the realtors ways to market themselves and their business. It works because we create referral partnerships. When the realtors can grow their buyer leads, they will send those buyers to us to get pre-qualified. - Ellicia Romo, Peoples Mortgage Co.
How will the soon-to-be-enacted NDAA alter the legal framework for military operations in the cyber domain? The House version of the bill would not have impacted this question much, but as I wrote here and here the Senate version had several interesting provisions. Well, those Senate provisions have emerged largely intact from the conference process, and the John McCain National Defense Authorization Act for fiscal 2019 almost certainly will become law soon. Here is the full text and accompanying conference report, what you need to know about how those cyber provisions turned out. Several existing cyber operation oversight measures are being moved around within the U.S. Code, which is good housekeeping but also annoying for those of us who are accustomed to the original numbering. Ah well. A 2015 statute directing SecDef to prepare for (and when properly authorized to do so, to conduct) cyber operations in response to hostile foreign cyber operations. A 2017 statute that requires SecDef to submit a written notice to the Senate Armed Services Committee and House Armed Services Committee within 48 hours of military cyber ops intended to have effect in foreign locations that are not combat zones (thus roughly paralleling the model of Title 50 covert action oversight). A 2017 statute that requires SecDef to give the Senate Armed Services Committee and House Armed Services Committee quarterly notice of “weapons reviews” for the legality of new cyber capacities, as well as 48-hour notice when such cyber “weapons” actually are used. Professors, update your syllabi accordingly! This section attempts to remove some interagency friction that apparently has limited Cyber Command’s capacity conduct cyber operations that would have effect outside of combat zones. If you are not a Title 10/Title 50 nerd like me, you just need to know that this is not really a new grant of affirmative authority to act but, rather, a statute to defeat arguments to the effect that the Defense Department somehow is precluded from carrying out deniable operations in cyberspace where the effect would occur outside a combat zone. Section 1632 is designed to put a stop to such objections, thus allowing CYBERCOM to conduct operations involving deniable infrastructure without having to face recurring objections that somehow they can’t count as TMA and thus must instead be treated as full-fledged T50 covert action. Note, too, that the report expressly encourages the president to alter the interagency review process to speed it up as needed, but Section 1632 does not actually purport to dictate process on this point. So far, so good. But what does Section 1632 actually say, and which part of U.S. Code will reflect this? Under new 10 U.S.C. §394(c), “clandestine military activity or operation in cyberspace shall be considered a traditional military activity” (emphasis added) for purposes of the Title 50 exemption to the covert action framework. Under new 10 U.S.C. §394(d), the secretary of defense shall include such activities during quarterly briefings to the Senate and House Armed Services Committees on Defense Department cyber operations (required by 10 U.S.C. §484, which absolutely should also have been moved to Chapter 19 along with the other stuff in the box above—something to do in the next NDAA!). While Congress cannot make the president issue orders to take more aggressive actions in response to malicious foreign cyber activities, it can express its wish that he would do so and it can pave the way a bit by granting preauthorization for some such responses. That’s what Section 1642 is all about. The conference report expresses frustration that the United States has not acted more aggressively in response to foreign hostile cyber activity. This clearly pertains to the current Trump acquiescence to Russia, but it also goes back to frustrations with the Obama administration as well. At any rate, Section 1642 underscores the fundamental concern that still more such activity is invited by failing to impose serious costs for past hostility. Hard to argue with that. Apart from that, though, what does 1642 do as a legal matter? 1. What triggers this authority? (2) The responsible party must be Russia, China, North Korea or Iran. Note that Section 1642 makes the “National Command Authority” the relevant decision maker on those triggers. The NCA is, of course, the president together with the secretary of defense. Very interesting to specify the NCA as opposed to just the president, no? 2. What is then authorized? Once those determinations are made by the NCA, Section 1642 pre-authorizes CYBERCOM in particular “to take appropriate and proportional action in foreign cyberspace to disrupt, defeat, and deter such attacks” (emphasis added by me). And the statute goes on to emphasize that this will count as “traditional military activity,” thus reinforcing Section 1632’s attempt to put an end to Title 50-related objections to CYBERCOM operations. 3. Is that really an AUMF-level of authority, or is it necessarily below the threshold at which the separation of powers comes into play and one arguably must have ongressional authorization? As Libya, Syria, Kosovo and other examples attest, the executive branch takes a strikingly narrow view of when it needs congressional authorization for military activity in addition to Article II authority. From that point of view, Section 1642’s approval for proportional cyber actions arguably is superfluous as a legal matter (however significant it might be as a matter of policy and politics). The War Powers Resolution (WPR) probably does not change that analysis, both because we might not be talking about activities that are likely to trigger the War Powers Resolution “clock” and because the notification requirements mentioned below (especially the one doubling-down on 10 U.S.C. §395) happen to be compatible with WPR notification requirements. Note: This makes it merely academic to ponder what to make of the language at the end of 1642, stating that 1642 should not be read to “affect” the War Powers Resolution or the 2001 AUMF. That’s a pretty ambiguous phrase, of course. Does it mean that the 1642 authority is capped out at the level that would rise to hostilities? Would any WPR clock objection instead be met fairly with the response that 1642 is adequate authorization, satisfying without “affecting” the WPR? 4. Will we know when this authority is used? First, Section 1642 specifies in an excess of caution that activities under this authority must be reported under 10 U.S.C. §395 (the old 10 U.S.C. §130j, with the requirement of a written notification from the secretary of defense within 48 hours). Second, Section 1642 also adds, in another excess of caution, that this requires reporting under the quarterly system of 10 U.S.C. §484. But of course neither of those systems specifies reporting to the public; outsiders are not often going to have a good sense of what, if any, use 1642 gets.
<reponame>ltabis/epitech-projects<gh_stars>0 /* ** EPITECH PROJECT, 2018 ** my_put_score ** File description: ** my_put_score */ #include "tetris.h" int count_len(int nb) { int count = 0; int tmp = nb; if (nb < 0) { count++; nb *= -1; tmp *= -1; } while (tmp > 10) { tmp /= 10; count++; } if (tmp == 10) count++; count++; return (count); } char *fill_str(char *str, int i, int nb, int tmp) { int tmp2 = nb; if (tmp2 < 0) tmp2 *= -1; for (; tmp2 > 10; i--) { tmp = tmp2; str[i] = tmp % 10 + '0'; tmp2 /= 10; } if (tmp == 100 || tmp == 0) { if (nb < 0) str[1] = '1'; else if (nb != 0) { str[0] = '1'; } } else str[i] = tmp2 % 10 + '0'; return (str); } char *my_put_score(int nb) { int i = 0; int tmp = 0; int len = count_len(nb); char *str = malloc(sizeof(char) * (len + 1)); if (str == NULL) return (NULL); str[len] = 0; for (int j = 0; j < len; j++) str[j] = '0'; i = my_strlen(str) - 1; if (nb < 0) { str[0] = '-'; //nb *= -1; } str = fill_str(str, i, nb, tmp); return (str); }
Comparing Results of Systematic Reviews: Parallel Reviews of Research on Repeated Reading Education and related services are relying increasingly on empirically supported treatments (ESTs), which have been shown to improve student outcomes through rigorous research. Many organizations have developed review systems with guidelines for judging the quality of studies and identifying ESTs. However, little explicit attention has been paid to issues of validity of these review systems. In this study, we used the criteria developed by Horner and colleagues, Gersten and colleagues, and the What Works Clearinghouse (WWC, 2008; ) to evaluate the research base on repeated reading. The corpus of literature reviewed was derived from previous narrative literature reviews and meta-analyses that concluded that repeated reading was an effective intervention for improving reading fluency. However, the review systems employed in this study resulted in the conclusion that repeated reading did not have enough high quality research support to be considered an EST. The current reviews relied on strict criteria for the quality of each individual study, whereas the previous reviews and meta-analyses included studies with a wider range of quality. These results demonstrate that systematic reviews that strictly appraise the quality of studies and reject those not meeting standards can be substantially more conservative than other scientific review methods. The finding that these different review methods (narrative, meta-analysis, and systematic) can produce diverging recommendations raises issues of validity for practice recommendations.