160 research outputs found

    Code Completion by Modeling Flattened Abstract Syntax Trees as Graphs

    Full text link
    Code completion has become an essential component of integrated development environments. Contemporary code completion methods rely on the abstract syntax tree (AST) to generate syntactically correct code. However, they cannot fully capture the sequential and repetitive patterns of writing code and the structural information of the AST. To alleviate these problems, we propose a new code completion approach named CCAG, which models the flattened sequence of a partial AST as an AST graph. CCAG uses our proposed AST Graph Attention Block to capture different dependencies in the AST graph for representation learning in code completion. The sub-tasks of code completion are optimized via multi-task learning in CCAG, and the task balance is automatically achieved using uncertainty without the need to tune task weights. The experimental results show that CCAG has superior performance than state-of-the-art approaches and it is able to provide intelligent code completion.Comment: Accepted in AAAI 2021. This version contains the appendix for the derivation of Eq. 1

    Accurate and efficient hydrodynamic analysis of structures with sharp edges by the Extended Finite Element Method (XFEM): 2D studies

    Full text link
    Achieving accurate numerical results of hydrodynamic loads based on the potential-flow theory is very challenging for structures with sharp edges, due to the singular behavior of the local-flow velocities. In this paper, we introduce the Extended Finite Element Method (XFEM) to solve fluid-structure interaction problems involving sharp edges on structures. Four different FEM solvers, including conventional linear and quadratic FEMs as well as their corresponding XFEM versions with local enrichment by singular basis functions at sharp edges, are implemented and compared. To demonstrate the accuracy and efficiency of the XFEMs, a thin flat plate in an infinite fluid domain and a forced heaving rectangle at the free surface, both in two dimensions, will be studied. For the flat plate, the mesh convergence studies are carried out for both the velocity potential in the fluid domain and the added mass, and the XFEMs show apparent advantages thanks to their local enhancement at the sharp edges. Three different enrichment strategies are also compared, and suggestions will be made for the practical implementation of the XFEM. For the forced heaving rectangle, the linear and 2nd order mean wave loads are studied. Our results confirm the previous conclusion in the literature that it is not difficult for a conventional numerical model to obtain convergent results for added mass and damping coefficients. However, when the 2nd order mean wave loads requiring the computation of velocity components are calculated via direct pressure integration, it takes a tremendously large number of elements for the conventional FEMs to get convergent results. On the contrary, the numerical results of XFEMs converge rapidly even with very coarse meshes, especially for the quadratic XFEM

    RefBERT: A Two-Stage Pre-trained Framework for Automatic Rename Refactoring

    Full text link
    Refactoring is an indispensable practice of improving the quality and maintainability of source code in software evolution. Rename refactoring is the most frequently performed refactoring that suggests a new name for an identifier to enhance readability when the identifier is poorly named. However, most existing works only identify renaming activities between two versions of source code, while few works express concern about how to suggest a new name. In this paper, we study automatic rename refactoring on variable names, which is considered more challenging than other rename refactoring activities. We first point out the connections between rename refactoring and various prevalent learning paradigms and the difference between rename refactoring and general text generation in natural language processing. Based on our observations, we propose RefBERT, a two-stage pre-trained framework for rename refactoring on variable names. RefBERT first predicts the number of sub-tokens in the new name and then generates sub-tokens accordingly. Several techniques, including constrained masked language modeling, contrastive learning, and the bag-of-tokens loss, are incorporated into RefBERT to tailor it for automatic rename refactoring on variable names. Through extensive experiments on our constructed refactoring datasets, we show that the generated variable names of RefBERT are more accurate and meaningful than those produced by the existing method

    EALink: An Efficient and Accurate Pre-trained Framework for Issue-Commit Link Recovery

    Full text link
    Issue-commit links, as a type of software traceability links, play a vital role in various software development and maintenance tasks. However, they are typically deficient, as developers often forget or fail to create tags when making commits. Existing studies have deployed deep learning techniques, including pretrained models, to improve automatic issue-commit link recovery.Despite their promising performance, we argue that previous approaches have four main problems, hindering them from recovering links in large software projects. To overcome these problems, we propose an efficient and accurate pre-trained framework called EALink for issue-commit link recovery. EALink requires much fewer model parameters than existing pre-trained methods, bringing efficient training and recovery. Moreover, we design various techniques to improve the recovery accuracy of EALink. We construct a large-scale dataset and conduct extensive experiments to demonstrate the power of EALink. Results show that EALink outperforms the state-of-the-art methods by a large margin (15.23%-408.65%) on various evaluation metrics. Meanwhile, its training and inference overhead is orders of magnitude lower than existing methods.Comment: 13 pages, 6 figures, published to AS

    Atypical interference control in children with AD/HD with elevated theta/beta ratio

    Get PDF
    The theta/beta ratio (TBR) is a major area of interest within electroencephalogram (EEG) research in AD/HD. While researchers suggest a prognostic role for TBR in AD/HD, its relationship to behavior remains uncertain. Recent evidence suggests that elevated TBR in AD/HD may be related to atypical inhibition, particularly at an attentional level. This study aimed to examine the performance on three inhibitory tasks of children with AD/HD. Fifty-eight children with AD/HD participated, divided into an elevated TBR (ET) group and a control group (CT). A behavioral disassociation was found − compared to CT, ET showed more difficulty in inhibiting surrounding stimuli but had less day-to-day inhibitory issues measured by BRIEF. There was no significant group difference on response inhibition. The results support the prognostic value of TBR in AD/HD. Elevated TBR may be an inhibitory biomarker; further studies are needed to explore the behavioral implications in patients without elevated TBR

    Eff ect of a comprehensive programme to provide universal access to care for sputum-smear-positive multidrugresistant tuberculosis in China: a before-and-after study

    Get PDF
    Background China has a quarter of all patients with multidrug-resistant tuberculosis (MDRTB) worldwide, but less than 5% are in quality treatment programmes. In a before-and-after study we aimed to assess the eff ect of a comprehensive programme to provide universal access to diagnosis, treatment, and follow-up for MDRTB in four Chinese cities (population 18 million). Methods We designated city-level hospitals in each city to diagnose and treat MDRTB. All patients with smear-positive pulmonary tuberculosis diagnosed in Center for Disease Control (CDC) clinics and hospitals were tested for MDRTB with molecular and conventional drug susceptibility tests. Patients were treated with a 24 month treatment package for MDRTB based on WHO guidelines. Outpatients were referred to the CDC for directly observed therapy. We capped total treatment package cost at US4644.Insurancereimbursementandprojectsubsidieslimitedpatients’expensesto10(2011)tothosefromaretrospectivesurveyofallpatientswithMDRTBdiagnosedinthesamecitiesduringabaselineperiod(2006–09).Findings243patientswerediagnosedwithMDRTBorrifampicin−resistanttuberculosisduringthe12monthprogrammeperiodcomparedwith92patients(equivalentto24peryear)duringthebaselineperiod.172(71243individualswereenrolledintheprogramme.Timefromspecimencollectionforresistancetestingtotreatmentinitiationdecreasedby90startedonappropriatedrugregimenincreased2⋅7times(fromnine[35172),andfollow−upbytheCDCafterinitialhospitalisationincreased24times(fromone[4163[99increasedtentimes(fromtwo[8programmeperiodhadnegativeculturesorclinical–radiographicimprovement.Patients’expensesforhospitaladmissionafterMDRTBdiagnosisdecreasedby784644. Insurance reimbursement and project subsidies limited patients’ expenses to 10% of charges for services within the package. We compared data from a 12 month programme period (2011) to those from a retrospective survey of all patients with MDRTB diagnosed in the same cities during a baseline period (2006–09). Findings 243 patients were diagnosed with MDRTB or rifampicin-resistant tuberculosis during the 12 month programme period compared with 92 patients (equivalent to 24 per year) during the baseline period. 172 (71%) of 243 individuals were enrolled in the programme. Time from specimen collection for resistance testing to treatment initiation decreased by 90% (from median 139 days [IQR 69–207] to 14 days [10–21]), the proportion of patients who started on appropriate drug regimen increased 2·7 times (from nine [35%] of 26 patients treated to 166 [97%] of 172), and follow-up by the CDC after initial hospitalisation increased 24 times (from one [4%] of 23 patients to 163 [99%] of 164 patients). 6 months after starting treatment, the proportion of patients remaining on treatment increased ten times (from two [8%] of 26 patients to 137 [80%] of 172), and 116 (67%) of 172 patients in the programme period had negative cultures or clinical–radiographic improvement. Patients’ expenses for hospital admission after MDRTB diagnosis decreased by 78% (from 796 to $174), reducing the ratio of patients’ expenses to annual household income from 17·6% to 3·5% (p<0·0001 for all comparisons between baseline and programme periods). However, 36 (15%) patients did not start or had to discontinue treatment in the programme period because of fi nancial diffi culties. Interpretation This comprehensive programme substantially increased access to diagnosis, quality treatment, and aff ordable treatment for MDRTB. The programme could help China to achieve universal access to MDRTB care but greater fi nancial risk protection for patients is needed

    Alterations in brain structure and function associated with pediatric growth hormone deficiency: A multi-modal magnetic resonance imaging study

    Get PDF
    IntroductionPediatric growth hormone deficiency (GHD) is a disease resulting from impaired growth hormone/insulin-like growth factor-1 (IGF-1) axis but the effects of GHD on children’s cognitive function, brain structure and brain function were not yet fully illustrated.MethodsFull Wechsler Intelligence Scales for Children, structural imaging, diffusion tensor imaging, and resting-state functional magnetic resonance imaging were assessed in 11 children with GHD and 10 matched healthy controls.Results(1) The GHD group showed moderate cognitive impairment, and a positive correlation existed between IGF-1 levels and cognitive indices. (2) Mean diffusivity was significantly increased in both corticospinal tracts in GHD group. (3) There were significant positive correlations between IGF-1 levels and volume metrics of left thalamus, left pallidum and right putamen but a negative correlation between IGF-1 levels and cortical thickness of the occipital lobe. And IGF-1 levels negatively correlated with fractional anisotropy in the superior longitudinal fasciculus and right corticospinal tract. (4) Regional homogeneity (ReHo) in the left hippocampus/parahippocampal gyrus was negatively correlated with IGF-1 levels; the amplitude of low-frequency fluctuation (ALFF) and ReHo in the paracentral lobe, postcentral gyrus and precentral gyrus were also negatively correlated with IGF-1 levels, in which region ALFF fully mediates the effect of IGF-1 on working memory index.ConclusionMultiple subcortical, cortical structures, and regional neural activities might be influenced by serum IGF-1 levels. Thereinto, ALFF in the paracentral lobe, postcentral gyrus and precentral gyrus fully mediates the effect of IGF-1 on the working memory index

    Endogenous relapse and exogenous reinfection in recurrent pulmonary tuberculosis: A retrospective study revealed by whole genome sequencing

    Get PDF
    BackgroundTuberculosis may reoccur due to reinfection or relapse after initially successful treatment. Distinguishing the cause of TB recurrence is crucial to guide TB control and treatment. This study aimed to investigate the source of TB recurrence and risk factors related to relapse in Hunan province, a high TB burden region in southern China.MethodsA population-based retrospective study was conducted on all culture-positive TB cases in Hunan province, China from 2013 to 2020. Phenotypic drug susceptibility testing and whole-genome sequencing were used to detect drug resistance and distinguish between relapse and reinfection. Pearson chi-square test and Fisher exact test were applied to compare differences in categorical variables between relapse and reinfection. The Kaplan–Meier curve was generated in R studio (4.0.4) to describe and compare the time to recurrence between different groups. p &lt; 0.05 was considered statistically significant.ResultsOf 36 recurrent events, 27 (75.0%, 27/36) paired isolates were caused by relapse, and reinfection accounted for 25.0% (9/36) of recurrent cases. No significant difference in characteristics was observed between relapse and reinfection (all p &gt; 0.05). In addition, TB relapse occurs earlier in patients of Tu ethnicity compared to patients of Han ethnicity (p &lt; 0.0001), whereas no significant differences in the time interval to relapse were noted in other groups. Moreover, 83.3% (30/36) of TB recurrence occurred within 3 years. Overall, these recurrent TB isolates were predominantly pan-susceptible strains (71.0%, 49/69), followed by DR-TB (17.4%, 12/69) and MDR-TB (11.6%, 8/69), with mutations mainly in codon 450 of the rpoB gene and codon 315 of the katG gene. 11.1% (3/27) of relapse cases had acquired new resistance during treatment, with fluoroquinolone resistance occurring most frequently (7.4%, 2/27), both with mutations in codon 94 of gyrA.ConclusionEndogenous relapse is the main mechanism leading to TB recurrences in Hunan province. Given that TB recurrences can occur more than 4 years after treatment completion, it is necessary to extend the post-treatment follow-up period to achieve better management of TB patients. Moreover, the relatively high frequency of fluoroquinolone resistance in the second episode of relapse suggests that fluoroquinolones should be used with caution when treating TB cases with relapse, preferably guided by DST results
    • …
    corecore