Code generation tasks aim to automate the conversion of user requirements into executable code, significantly reducing manual development efforts and enhancing software productivity. The emergence of large language models (LLMs) has significantly advanced code generation, though their efficiency is still impacted by certain inherent architectural constraints. Each token generation necessitates a complete inference pass, requiring persistent retention of contextual information in memory and escalating resource consumption. While existing research prioritizes inference-phase optimizations such as prompt compression and model quantization, the generation phase remains underexplored. To tackle these challenges, we propose a knowledge-infused framework named ShortCoder, which optimizes code generation efficiency while preserving semantic equivalence and readability. In particular, we introduce: (1) ten syntax-level simplification rules for Python, derived from AST-preserving transformations, achieving 18.1
In recent years, Large Language Models (LLMs) have achieved remarkable success and have been widely used in various downstream tasks, especially in the tasks of the software engineering (SE) field. We find that many studies combining LLMs with SE have employed the concept of agents either explicitly or implicitly. However, there is a lack of an in-depth survey to sort out the development context of existing works, analyze how existing works combine the LLM-based agent technologies to optimize various tasks, and clarify the framework of LLM-based agents in SE. In this paper, we conduct the first survey of the studies on combining LLM-based agents with SE and present a framework of LLM-based agents in SE which includes three key modules: perception, memory, and action. We also summarize the current challenges in combining the two fields and propose future opportunities in response to existing challenges. We maintain a GitHub repository of the related papers at: https://github.com/DeepSoftwareAnalytics/Awesome-Agent4SE.
Code summarization aims to generate natural language descriptions of source code, facilitating programmers to understand and maintain it rapidly. While previous code summarization efforts have predominantly focused on method-level, this paper studies file-level code summarization, which can assist programmers in understanding and maintaining large source code projects. Unlike method-level code summarization,file-level code summarization typically involves long source code within a single file, which makes it challenging for Transformer-based models to understand the code semantics for the maximum input length of these models is difficult to set to a large number that can handle long code input well, due to the quadratic scaling of computational complexity with the input sequence length. To address this challenge, we propose SparseCoder, an identifier-aware sparse transformer for effectively handling long code sequences. Specifically, the SparseCoder employs a sliding window mechanism for self-attention to model short-term dependencies and leverages the structure message of code to capture long-term dependencies among source code identifiers by introducing two types of sparse attention patterns named global and identifier attention. To evaluate the performance of SparseCoder, we construct a new dataset FILE-CS for file-level code summarization in Python. Experimental results show that our SparseCoder model achieves state-of-the-art performance compared with other pre-trained models, including full self-attention and sparse models. Additionally, our model has low memory overhead and achieves comparable performance with models using full self-attention mechanism.
Code search, which aims at retrieving the most relevant code fragment for a given natural language query, is a common activity in software development practice. Recently, contrastive learning is widely used in code search research, where many data augmentation approaches for source code (e.g., semantic-preserving program transformation) are proposed to learn better representations. However, these augmentations are at the raw-data level, which requires additional code analysis in the preprocessing stage and additional training costs in the training stage. In this paper, we explore augmentation methods that augment data (both code and query) at representation level which does not require additional data processing and training, and based on this we propose a general format of representation-level augmentation that unifies existing methods. Then, we propose three new augmentation methods (linear extrapolation, binary interpolation, and Gaussian scaling) based on the general format. Furthermore, we theoretically analyze the advantages of the proposed augmentation methods over traditional contrastive learning methods on code search. We experimentally evaluate the proposed representation-level augmentation methods with state-of-the-art code search models on a large-scale public dataset consisting of six programming languages. The experimental results show that our approach can consistently boost the performance of the studied code search models. Our source code is available at https://github.com/Alex-HaochenLi/RACS.
本文是在建设高水平理工科大学的背景下,以广东石油化工学院为例,提升教学和科研水平为驱动,提出关于高校教师教学与科研协调发展的解决方案.教学与科研是大学教育的两项重要任务,教学与科研的协调发展不仅促进高校教学质量的提高和科研水平的提升,而且对高水平理工科大学的建设具有重要的推动作用.就此问题,本文分析了高校教师教学与科研的密切关系,并探讨了教学与科研协调发展的四大措施.
在大学有机化学的经典实验“从茶叶中提取咖啡因”的基础上,设计了以氰乙酸与二甲基脲为原料的“咖啡因的化学合成与表征”综合性实验.该实验操作过程易于控制,重复性较好,通过熔点、紫外、红外、核磁共振、质谱等手段对产物进行了结构表征.通过该实验,学生不仅可以巩固蒸馏、过滤及重结晶等基本实验操作,而且有助于提高对有机化合物合成研究过程的认识,有利于学生综合实验能力的培养.
介绍了以2-碘苯胺和苯硼酸为原料,通过Suzuki偶联反应、重氮化反应、氧化反应等3步合成环状二苯基碘盐,并进一步应用于二苯并噻吩的合成.本实验涉及有机化合物的合成、结构表征以及应用,将有机化学基础理论知识、基本实验技能与学科研究热点相结合,能够有效培养学生的科学研究素养.该实验牵涉到气相质谱、核磁及熔点仪等仪器的使用,锻炼学生动手操作仪器的能力及综合实验技能,适合作为高年级学生的综合实验.
: In response to the problems existing in the traditional English for chemistry teaching, a new mode is proposed merging task-based method with rain classroom. The characteristics of the integration of task orientation with rain classroom are analyzed and the teaching procedure, methods and effects in the course are described. Questionnaire survey and qualitative comparison are used to examine the effect of this teaching mode. The results show that the teaching mode can significantly improve the classroom atmosphere, teacher-student interaction and student participation; the integration of rain classroom can significantly improve the effect of task-based teaching; rain classroom can improve the daily teaching management to a certain extent; and the teaching mode can improve students’ interest as well as academic performance.
本文在慕课平台上将以问题为基础的教学法(PBL)融入到有机化学的教学当中.对慕课资源的选择、课堂问题设计、教学实施、教学效果和存在的问题与启示等方面进行了探讨.实践证明,慕课平台上PBL教学效果明显,提高了学生探究问题、解决问题的能力,有利于应用型人才的培养.
“互联网+教育”背景下,雨课堂的诞生使高校教学改革得到创新.本文将雨课堂应用于有机化学课程的教学中进行初步实践探讨,针对课程教学现状,教学改革实践,以及实践效果进行阐述和分析.初步实践表明,“互联网+教育”背景下雨课堂的智慧教学模式提高了大学生的自主学习能力,激发了学生的学习活力,提高了教与学的质量.
Using cyclohexane-hexanol-Triton-X-100-water as a microemulsion system ,we synthesized nanoscaled sulfuric acid doped polyaniline (PANI-H2 SO4 ) by a reverse microemulsion method ,characterized its structure by SEM ,FTIR ,and studied the adsorption property of PANI-H2SO4 to Cr(Ⅵ) .The results show that the surface of PANI-H2 SO4 is loose and porous ,and its structure is sponge-like .The average adsorption rate reached 97 .06% in 50 mL K2 Cr2 O7 solution with Cr (Ⅵ) concentration of 50 mg · L -1 under the optimal conditions as follows :PANI-H2SO4 (molar ratio of sulfuric acid to aniline was 1 .2:1) dosage was 0 .150 g ,pH value of solu-tion was 2 ,adsorption temperature was 65 ℃ ,and adsorption time was 90 min .Kinetic analysis indicated that the adsorption process of PANI-H2 SO4 to Cr(Ⅵ) fitted the Langmuir isothermal adsorption model and pseudo-second order kinetic equation.
Ethyl laurate was synthesized by using lauric acid and anhydrous ethanol as the raw material, ionic liquid[hnmp]HSO4 as the catalyst and 4A molecular sieve as the dehydrating agent. The structure of product was analyzed by means of FT-IR and GC-MS. On the basis of single-factor experiments,the orthogonal experiments was carried out to obtain the optimized reaction condition. The results showed that the yield of ethyl laurate could reach up to 92 . 38% under the optimal condition as follows:ionic liquid amount 1. 50 g,lauric acid/anhydrous ethanol molar ratio 0. 04:0. 60,reaction temperature 85 ℃ and reaction time 10 h.[ hnmp]HSO4 ionic liquid for synthesis of ethyl laurate had good catalytic activity even after being reused for 4 times.
本文在分析了教学方法含义的基础上,剖析了化工类专业基础化学课程的教学特征,提出了在化工类专业基础化学课程教学中实施立体化教学方法,并从实践层面进行了课程教学初步尝试.
The organic chemical products in the construction of resource sharing lessons, such as the construction of teaching team, optimization of the teaching content system and practice and experience of the construction of network platform, were introduced.Lesson showed that construction quality resource sharing was the key to have a reasonable knowledge structure, age structure, title structure, personnel stability, high teaching level and teaching effect was good, with a strong sense of responsibility and team spirit, good teachers.
对石油化工院校的有机化学综合设计实验教学进行探索.实验内容选择有代表性的有机化学反应类型及实验装置,大部分实验都将合成、分离、提纯、物性的测定和波谱鉴定等环节串联成一体.从注重研究方法,重视实验预习指导,提高学生实验技能几个方面改进合成实验教学,取得了良好的教学效果,有效地培养和提高了学生独立分析问题和解决问题的能力,锻炼了动手能力,训练了思维能力.
Here we report a type of N-heterocyclic carbene (NHC)- and phosphine-chelated palladium catalysts with poly(ethylene glycol) (PEG) chain for Suzuki–Miyaura cross-coupling reactions. 1-(2-Diphenylphosphinoferrocenyl)-ethyl-3-imidazolium iodides conjugated with MeO–PEG400 and MeO–PEG750, respectively, have been synthesized and characterized. It was demonstrated that the salts bearing with PEG chain could act as NHC precursors successfully under the catalytic condition to form NHC-supported palladium complexes joined by phosphine. The formed palladium complexes are highly efficient for Suzuki–Miyaura coupling of aryl bromides with phenylboronic acid at the palladium loading of 0.1 mol% in both organic and aqueous solvents.
In order to effectively improve the quality of teaching , the effective teaching quality monitoring would be built by the supervision of teaching process , examination , feedback and guidance.According to instructional supervision fact of chemistry college , how to make a secondary college teaching supervision work more standardized and institutionalized , reform and innovation of classroom teaching mode was promote from the function of teaching supervision , experience, advice, etc.to promote the reform and innovation of classroom teaching mode.The teaching level of teachers was enhanced.
Via four steps of nucleophilic ring-opening of alpha-D-manno-epoxide with Ph2P(-) anion, adduction of boranes to phospnine, methylation of hydroxyl, and deprotection of the phosphine-boranes adduct, afforded the desired methyl 3-deoxy-3-diphenylphosphino-2-O-methyl-4,6-O-phenylmethenyl-alpha-D-pyranoaltroside (5) in 55% of yield. It was found that: (1) the adduct of boranes to the carbohydrate-based phosphine was formed smoothly in the presence of alkyloxide, (2) the alkoxide derived from the secondary alcohol of pyranoside was methylized with MeI as in its sodium salt other than in lithium salt in THF at room temperature, and (3) the deprotection of boranes from the carbohydrate-based phosphine adduct went smoothly by several of organic bases, but more efficiently by ethanol. The corresponding cis- and trans-[Pt(5)(2)Cl-2] formed by the reaction of the carbohydrate-based phosphine 5 with cis- and trans-[Pt(NCMe)(2)Cl-2], respectively. The coupling constant (1)J(Pt-P) was reliable to assign the configuration of the geometrical stereoisomers of Pt(II) complexes with the carbohydrate-based phosphine.
p-toluenesulphonic acid(TsOH) supported on active carbon(TsOH /C) solid acid catalyst was prepared by incipient impregnation process.Dithiodinglycol dipalmiticctate was synthesized from thiodiglyco and palmitic acid through esterification,with TsOH /C as catalyst.The effects of immersion time of catalyst,drying temperature,TsOH loading,reaction temperature,n(thiodiglyco)∶n(palmitic acid)and catalyst dosage on the synthesis were discussed.Optimal conditions are: immersion of activated carbon in the p-toluenesulfonic acid solution with concentration of 25% for 35 h,drying TsOH /C catalyst at temperature of 110 ℃,TsOH loading(mass fraction)20%,catalyst dosage 0.8 g for esterification,n(thiodiglyco)∶n(palmitic acid)= 1.5∶1,reaction temperature 170~180 ℃,and 30 mL Xylene(dimethylbenzene) as azetropic water remover(dehydrant).Under these conditions the yield of dithiodinglycol dipalmitate was up to 98.6%.Structure of the product was characterized by IR,1H NMR,13C NMR,MS and elementary analysis.Under the optimum conditions,TsOH solid acid catalyst supported on active carbon features simple preparation procedure,high catalytic activity,good repeatability.
Benzoic acid was synthesized from benzyl alcohol and potassium permanganate by three different phase transfer catalysts(diethylene glycol dimethyl ether,tetrabutylammonium bromide,cetyl trimethyl ammonium bromide,i.e.CTAB).The effects of amount of potassium permanganate,the variations in kinds and concentrations of catalysts on benzoic acid yield were investigated.The results showed that phase transfer catalysts had good catalytic activity for the synthesis of benzoic acid from benzyl alcohol in water,and CTAB was the best option.The optimum reaction condition was benzyl alcohol/ potassium permanganate(molar ratio) =1:2.5.The yield of benzoic acid could reach 77.4%under the followed optimum reaction condition;2.6 mL benzyl alcohol,5.53 g potassium permanganate,80 mL water,0.12 g CTAB as phase transfer catalyst,reaction temperature 90℃,reaction time 1 h and alkaline condition.The yield was increased by 30%compared with that obtained under the same optimum condition without any catalysts.