C-REX An Evolutionary Code Extractor for C

合集下载

ctf乱码解题工具

ctf乱码解题工具

ctf乱码解题工具CTF(Capture The Flag) 比赛中经常会涉及到乱码解题,这是因为在一些二进制文件中可能存在乱码,需要解码才能获取到真正的内容。

乱码解题也是 CTF 比赛中的一个热门主题,下面介绍一些常用的乱码解题工具:1. Hex-Rays:Hex-Rays 是一个开源的二进制分析工具,可以帮助用户分析二进制文件的结构,包括乱码解码。

Hex-Rays 支持多种解码算法,包括 UTF-8、UTF-16、UTF-32 等,同时也支持多种文件格式的分析,如 Shellcode、恶意软件、加密文件等。

2. Autopsy:Autopsy 是一个免费的开源二进制分析工具,可以帮助用户分析二进制文件的结构,包括乱码解码。

Autopsy 支持多种解码算法,包括 UTF-8、UTF-16、UTF-32 等,同时也支持多种文件格式的分析,如 Shellcode、恶意软件、加密文件等。

3. OllyDbg: OllyDbg 是一款 Windows 平台上的二进制调试工具,可以帮助用户调试二进制文件,包括乱码解码。

OllyDbg 支持多种解码算法,包括 UTF-8、UTF-16、UTF-32 等,同时也支持多种文件格式的分析,如 Shellcode、恶意软件、加密文件等。

4. xxd:xxd 是一个命令行工具,可以用来解码和编码二进制文件。

xxd 支持多种解码算法,包括 UTF-8、UTF-16、UTF-32 等,同时也支持多种文件格式的分析,如 Shellcode、恶意软件、加密文件等。

以上是一些常用的乱码解题工具,它们都可以帮助用户解码二进制文件中的乱码,获取到真正的内容。

同时,在 CTF 比赛中,乱码解题也是一个非常热门的挑战主题,需要选手具备较高的二进制分析和解码能力。

codewards level4 题befunge interpreter

codewards level4 题befunge interpreter

codewards level4 题befunge interpreter【最新版】目录1.CodeWards Level 4 题目概述2.BeFunge 解释器的概念与应用3.BeFunge 解释器的实现过程4.CodeWards Level 4 题目的挑战与解决方案5.总结正文【1.CodeWards Level 4 题目概述】CodeWards 是一个面向编程初学者的在线挑战平台,提供各种难度级别的编程题目。

在本文中,我们将讨论 CodeWards Level 4 中的一道题目,该题目涉及到 BeFunge 解释器的实现。

【2.BeFunge 解释器的概念与应用】BeFunge 是一种功能性编程语言,其解释器用于将源代码转换为可执行的机器码。

BeFunge 解释器在编程语言实现、编译原理等领域具有重要的应用价值。

在这道题目中,我们需要实现一个 BeFunge 解释器,以解析和执行 BeFunge 语言编写的程序。

【3.BeFunge 解释器的实现过程】实现 BeFunge 解释器需要经历以下几个步骤:(1) 词法分析:首先,我们需要编写一个词法分析器,用于将源代码中的字符序列转换为记号(token)序列。

(2) 语法分析:接下来,我们需要编写一个语法分析器,将记号序列转换为抽象语法树(AST)。

(3) 语义分析:在完成语法分析后,我们需要对抽象语法树进行语义分析,以检查代码是否存在语义错误。

(4) 解释执行:最后,我们需要实现一个解释器,根据抽象语法树生成的中间代码来解释和执行程序。

【4.CodeWards Level 4 题目的挑战与解决方案】这道题目的挑战在于实现一个功能完善的 BeFunge 解释器,并解决在解释执行过程中可能出现的各种问题。

为了成功完成这道题目,我们需要熟练掌握编译原理的相关知识,并具备一定的编程实践经验。

【5.总结】通过对 CodeWards Level 4 题目中 BeFunge 解释器的实现过程进行分析,我们可以了解到编译原理的基本概念和实现方法。

犀牛中文教程:Rhinoceros 3D 参考手册 Rhinoceros NURBS modeling forWindows

犀牛中文教程:Rhinoceros 3D 参考手册 Rhinoceros NURBS modeling forWindows

RHINO参 考 手 册
Rhinoceros

4 页 , 共 733 页
使 下 一 個 觀 視 視 窗 成 為 最 上 層 觀 視 視 窗 (NextViewportToTop) ................................ ......41 關 閉 觀 視 視 窗 (CloseViewport) ................................ ................................ ..................... 42 放 大 觀 視 視 窗 (MaxViewport) ................................ ................................ ........................ 42 複 製 窗 至 所 有 的 觀 視 視 窗 (CopyViewToAll) ................................ ................................ ...42 設 定 最 大 觀 視 視 窗 (SetMaximizedViewport) ................................ ................................ .42 複 製 顯 示 視 窗 至 剪 貼 簿 (CopyDisplayWindowToClipboard)................................ .........43 選 取 色 彩 對 話 窗 (Select Color dialog box) ................................ ................................ ...43 顯 示 指 令 歷 史 (Command history display) ................................ ................................ ...44 指 令 歷 史 (CommandHistory)................................ ................................ ........................ 44 貼 上 指 令 (CommandPaste) ................................ ................................ .......................... 44 讀 入 指 令 檔 (ReadCommandFile) ................................ ................................ ................. 45 第 3章 檔 案 功 能 表 ................................ ................................ ................................ ............. 47

安装和配置指南

安装和配置指南
2005 SP1 Redistributable Package ...................6 软件许可 ..................................................................................7
可用许可证 ......................................................................7
目录
准备安装 ..................................................................................1 关于 SAP Sybase IQ .......................................................1 支持的服务器平台 ..................................................1 支持的客户端平台 ..................................................1 许可要求 ................................................................1 安装介质 ................................................................2 规划安装 .........................................................................2 首次安装 ................................................................2 从早期版本升级 ......................................................2 更改硬件平台 .........................................................3 规划分布式查询处理或高可用性 ............................3 预安装任务 ......................................................................3 检查操作系统补丁 ..................................................3 增加交换空间 .........................................................4 许可证服务器要求 ..................................................4 调整共享内存分配 ..................................................4 启用 I/O 完成端口 (IOCP) ......................................4 安装 IBM XL C/C++ 可再分发库 ............................5 增加最大用户进程数 ..............................................5 安装 IFIX IZ16878 ..................................................5 检验网络功能 .........................................................6 Windows 安装程序需要 Microsoft Visual C++

2010-26-EU-欧盟新排放指令

2010-26-EU-欧盟新排放指令

DIRECTIVESCOMMISSION DIRECTIVE 2010/26/EUof 31 March 2010amending Directive 97/68/EC of the European Parliament and of the Council on the approximation of the laws of the Member States relating to measures against the emission of gaseous and particulate pollutants from internal combustion engines to be installed in non-road mobile machinery(Text with EEA relevance)THE EUROPEAN COMMISSION, Having regard to the Treaty on the Functioning of the European Union,Having regard to Directive 97/68/EC of 16 December 1997 of the European Parliament and of the Council on the approxi ­mation of the laws of the Member States relating to measures against the emission of gaseous and particulate pollutants from internal combustion engines to be installed in non-road mobile machinery ( 1 ), and in particular Articles 14 and 14a thereof, Whereas:(1) Article 14a of Directive 97/68/EC sets out the criteria and the procedure for extending the period referred to in Article 9a(7) of that Directive. Studies carried out in accordance with Article 14a of Directive 97/68/EC show that there are substantial technical difficulties to comply with stage II requirements for professional use, multi- positional, hand-held mobile machinery in which engines of classes SH:2 and SH:3 are installed. It is therefore necessary to extend the period referred to in Article 9a(7) until 31 July 2013. (2) Since the amendment of Directive 97/68/EC in 2004, technical progress has been made in the design of diesel engines with a view to make them compliant with the exhaust emission limits for stages IIIB and IV. Electronically controlled engines, largely replacing me- chanically controlled fuel injection and control systems, have been developed. Therefore, the current general type- approval requirements in Annex I to Directive 97/68/EC should be adapted accordingly and general type-approval requirements for stages IIIB and IV should be introduced. (3) Annex II to Directive 97/68/EC specifies the technical details of the information documents that need to be submitted by the manufacturer to the type-approval authority with the application for engine type-approval. The details specified regarding the additional anti- pollution devices are generic and should be adapted to the specific after-treatment systems that need to be used to ensure that engines comply with exhaust emission limit stages IIIB and IV. More detailed information on the after-treatment devices installed on the engines should be submitted to enable type-approval authorities to assess the engine’s capability to comply with stages IIIB and IV.(4) Annex III to Directive 97/68/EC sets out the methodtesting the engines and determining their level of emissions of gaseous and particulate pollutants. The type-approval testing procedure of engines to demon ­strate compliance with the exhaust emission limits of stage IIIB and IV should ensure that the simultaneous compliance with the gaseous (carbon monoxide, hydro ­carbons, oxides of nitrogen) and the particulate emission limits is demonstrated. The non-road steady cycle (NRSC) and non-road transient cycle (NRTC) should be adapted accordingly. (5) Point 1.3.2 of Annex III to Directive 97/68/EC foreseesthe modification of the symbols (section 2.18 of Annex I), the test sequence (Annex III) and calculation equations (Appendix III to Annex III), prior to the introduction of the cold/hot composite test sequence. The type approval procedure to demonstrate compliance with the exhaust emission limits of stage IIIB and IV requires the intro ­duction of a detailed description of the cold start cycle. (6) Section 3.7.1 of Annex III to Directive 97/68/EC sets out the test cycle for the different equipment specifications. The test cycle under point 3.7.1.1 (specification A) needs to be adapted to clarify which engine speed needs to be used in the type approval calculation method. It is also necessary to adapt the reference to the updated version of the international testing standard ISO 8178-4:2007.( 1 ) OJ L 59, 27.2.1998, p. 1.(7) Section 4.5 of Annex III to Directive 97/68/EC outlines the emissions test run. This section needs to be adapted to take account of the cold start cycle. (8) Appendix 3 of Annex III to Directive 97/68/EC sets out the criteria for the data evaluation and calculation of the gaseous emissions and the particulate emissions, for both the NRSC test and the NRTC test set out in Annex III. The type approval of engines in accordance with stage IIIB and IV requires the adaptation of the calculation method for the NRTC test. (9) Annex XIII to Directive 97/68/EC sets out the provisions for engines placed on the market under a ‘flexible scheme’. To ensure a smooth implementation of stage IIIB, an increased use of this flexibility scheme may be needed. Therefore, the adaptation to technical progress to enable the introduction of stage IIIB compliant engines needs to be accompanied by measures to avoid that the use of the flexibility scheme may be hampered by notifi ­cation requirements which are no longer adapted to the introduction of such engines. The measures should aim at simplifying the notification requirements and the reporting obligations, and at making them more focused and tailored to the need for market surveillance authorities to respond to the increased use of the flexi ­bility scheme that will result from the introduction of stage IIIB. (10) Since Directive 97/68/EC provides for the type-approval of stage IIIB engines (category L) as from 1 January 2010 it is necessary to provide for the possibility to grant type approval from that date. (11) For reasons of legal certainty this Directive should enter into force as a matter of urgency. (12) The measures provided for in this Directive are in accordance with the opinion of the Committee estab ­lished in Article 15(1) of Directive 97/68/EC, HAS ADOPTED THIS DIRECTIVE: Article 1 Amendments to Directive 97/68/EC Directive 97/68/EC is amended as follows: 1. in Article 9a(7), the following subparagraph is added: ‘Notwithstanding the first subparagraph, an extension of the derogation period is granted until 31 July 2013, within the category of top handle machines, for professional use, multi- positional, hand-held hedge trimmers and top handle tree service chainsaws in which engines of classes SH:2 and SH:3 are installed.’;2. Annex I is amended in accordance with Annex I to this Directive;3. Annex II is amended in accordance with Annex II to this Directive;4. Annex III is amended in accordance with Annex III to this Directive;5. Annex V is amended in accordance to Annex IV to this Directive;6. Annex XIII is amended in accordance with Annex V to this Directive.Article 2Transitional provisionWith effect from the day following the publication of this Directive in the Official Journal, Member States may grant type-approval in respect of electronically controlled engines which comply with the requirements laid down in Annexes I, II, III, V and XIII to Directive 97/68/EC, as amended by this Directive.Article 3Transposition1. Member States shall bring into force the laws, regulations and administrative provisions necessary to comply with the Directive within 12 months after the publication of the Directive. They shall forthwith communicate to the Commission the text of those provisions.They shall apply those provisions from 31 March 2011.When Member States adopt those provisions, they shall contain a reference to this Directive or be accompanied by such a reference on the occasion of their official publication. Member States shall determine how such reference is to be made.2. Member States shall communicate to the Commission the text of the main provisions of national law which they adopt in the field covered by this Directive.Article 4Entry into forceThis Directive shall enter into force on the day following its publication in the Official Journal of the European Union .Article 5AddresseesThis Directive is addressed to the Member States. Done at Brussels, 31 March 2010. For the Commission The President José Manuel BARROSOANNEX IThe following section 8 is added to Annex I to Directive 97/68/EC:IIIBIVSTAGESANDFOR‘8. TYPEAPPROVALREQUIREMENTS8.1. This section shall apply to the type-approval of electronically controlled engines, which uses electronic control todetermine both the quantity and timing of injecting fuel (hereafter “engine”). This section shall apply irrespective of the technology applied to such engines to comply with the emission limit values set out in sections 4.1.2.5 and 4.1.2.6 of this Annex.8.2. DefinitionsFor the purpose of this section, the following definitions shall apply:8.2.1. “emission control strategy” means a combination of an emission control system with one base emission controlstrategy and with one set of auxiliary emission control strategies, incorporated into the overall design of an engine or non-road mobile machinery into which the engine is installed.8.2.2. “reagent” means any consumable or non-recoverable medium required and used for the effective operation of theexhaust after-treatment system.8.3. Generalrequirements8.3.1. Requirements for base emission control strategy8.3.1.1. The base emission control strategy, activated throughout the speed and torque operating range of the engine,shall be designed as to enable the engine to comply with the provisions of this Directive8.3.1.2. Any base emission control strategy that can distinguish engine operation between a standardised type approvaltest and other operating conditions and subsequently reduce the level of emission control when not operating under conditions substantially included in the type approval procedure is prohibited.8.3.2. Requirements for auxiliary emission control strategy8.3.2.1. An auxiliary emission control strategy may be used by an engine or a non-road mobile machine, provided thatthe auxiliary emission control strategy, when activated, modifies the base emission control strategy in response toa specific set of ambient and/or operating conditions but does not permanently reduce the effectiveness of theemission control system:(a) where the auxiliary emission control strategy is activated during the type approval test, sections 8.3.2.2 and8.3.2.3 shall not apply;(b) where the auxiliary emission control strategy is not activated during the type approval test, it must bedemonstrated that the auxiliary emission control strategy is active only for as long as required for thepurposes identified in section 8.3.2.3.8.3.2.2. The control conditions applicable to this section are all of the following:(a) an altitude not exceeding 1 000 metres (or equivalent atmospheric pressure of 90 kPa);(b) an ambient temperature within the range 275 K to 303 K (2 °C to 30 °C);(c) the engine coolant temperature above 343 K (70 °C).Where the auxiliary emission control strategy is activated when the engine is operating within the control conditions set out in points (a), (b) and (c), the strategy shall only be activated exceptionally.8.3.2.3. An auxiliary emission control strategy may be activated in particular for the following purposes:(a) by onboard signals, for protecting the engine (including air-handling device protection) and/or non-roadmobile machine into which the engine is installed from damage;(b) for operational safety and strategies;(c) for prevention of excessive emissions, during cold start or warming-up, during shut-down;(d) if used to trade-off the control of one regulated pollutant under specific ambient or operating conditions, formaintaining control of all other regulated pollutants, within the emission limit values that are appropriate forthe engine concerned. The purpose is to compensate for naturally occurring phenomena in a manner thatprovides acceptable control of all emission constituents.8.3.2.4. The manufacturer shall demonstrate to the technical service at the time of the type-approval test that theoperation of any auxiliary emission strategy complies with the provisions of section 8.3.2. The demonstration shall consist of an evaluation of the documentation referred to in section 8.3.3.8.3.2.5. Any operation of an auxiliary emission control strategy not compliant with section 8.3.2 is prohibited.8.3.3. Documentation requirements8.3.3.1. The manufacturer shall provide an information folder accompanying the application for type-approval at thetime of submission to the technical service, which ensures access to any element of design and emission control strategy and the means by which the auxiliary strategy directly or indirectly controls the output variables. The information folder shall be made available in two parts:(a) the documentation package, annexed to the application for type-approval, shall include a full overview of theemission control strategy. Evidence shall be provided that all outputs permitted by a matrix, obtained fromthe range of control of the individual unit inputs, have been identified. This evidence shall be attached to theinformation folder as referred to in Annex II;(b) the additional material, presented to the technical service but not annexed to the application for type-approval, shall include all the modified parameters by any auxiliary emission control strategy and theboundary conditions under which this strategy operates and in particular:(i) a description of the control logic and of timing strategies and switch points, during all modes ofoperation for the fuel and other essential systems, resulting in effective emissions control (such asexhaust gas recirculation system (EGR) or reagent dosing);(ii) a justification for the use of any auxiliary emission control strategy applied to the engine, accompanied by material and test data, demonstrating the effect on exhaust emissions. This justification may be basedon test data, sound engineering analysis, or a combination of both;(iii) a detailed description of algorithms or sensors (where applicable) used for identifying, analysing, or diagnosing incorrect operation of the NO x control system;(iv) the tolerance used to satisfy the requirements in section 8.4.7.2, regardless of the used means.8.3.3.2. The additional material referred to in point (b) of section 8.3.3.1 shall be treated as strictly confidential. It shallbe made available to the type-approval authority on request. The type-approval authority shall treat this material as confidential.ofoperationNO x control measures8.4. Requirementstoensurecorrect8.4.1. The manufacturer shall provide information that fully describes the functional operational characteristics of theNO x control measures using the documents set out in section 2 of Appendix 1 to Annex II and in section 2 of Appendix 3 to Annex II.8.4.2. If the emission control system requires a reagent, the characteristics of that reagent, including the type of reagent,information on concentration when the reagent is in solution, operational temperature conditions and reference to international standards for composition and quality must be specified by the manufacturer, in section 2.2.1.13 of Appendix 1 and in section 2.2.1.13 of Appendix 3 to Annex II.8.4.3. The engine emission control strategy shall be operational under all environmental conditions regularly pertainingin the territory of the Community, especially at low ambient temperatures.8.4.4. The manufacturer shall demonstrate that the emission of ammonia during the applicable emission test cycle ofthe type approval procedure, when a reagent is used, does not exceed a mean value of 25 ppm.8.4.5. If separate reagent containers are installed on or connected to a non-road mobile machine, means for taking asample of the reagent inside the containers must be included. The sampling point must be easily accessible without requiring the use of any specialised tool or device.8.4.6. Use and maintenance requirements8.4.6.1. The type approval shall be made conditional, in accordance with Article 4(3), upon providing to each operator ofnon-road mobile machinery written instructions comprising the following:(a) detailed warnings, explaining possible malfunctions generated by incorrect operation, use or maintenance ofthe installed engine, accompanied by respective rectification measures;(b) detailed warnings on the incorrect use of the machine resulting in possible malfunctions of the engine,accompanied by respective rectification measures;(c) information on the correct use of the reagent, accompanied by an instruction on refilling the reagentbetween normal maintenance intervals;(d) a clear warning, that the type-approval certificate, issued for the type of engine concerned, is valid only whenall of the following conditions are met:(i) the engine is operated, used and maintained in accordance with the instructions provided;(ii) prompt action has been taken for rectifying incorrect operation, use or maintenance in accordance with the rectification measures indicated by the warnings referred to in point (a) and (b);(iii) no deliberate misuse of the engine has taken place, in particular deactivating or not maintaining an EGR or reagent dosing system.The instructions shall be written in a clear and non-technical manner using the same language as is used in the operator’s manual on non-road mobile machinery or engine.8.4.7. Reagent control (where applicable)8.4.7.1. The type approval shall be made conditional, in accordance with the provisions of section 3 of Article 4, uponproviding indicators or other appropriate means, according to the configuration of the non-road mobile machinery, informing the operator on:(a) the amount of reagent remaining in the reagent storage container and by an additional specific signal, whenthe remaining reagent is less than 10 % of the full container’s capacity;(b) when the reagent container becomes empty, or almost empty;(c) when the reagent in the storage tank does not comply with the characteristics declared and recorded insection 2.2.1.13 of Appendix 1 and section 2.2.1.13 of Appendix 3 to Annex II, according to the installedmeans of assessment.(d) when the dosing activity of the reagent is interrupted, in cases other than those executed by the engine ECUor the dosing controller, reacting to engine operating conditions where the dosing is not required, providedthat these operating conditions are made available to the type approval authority.8.4.7.2. By the choice of the manufacturer the requirements of reagent compliance with the declared characteristics andthe associated NO x emission tolerance shall be satisfied by one of the following means:(a) direct means, such as the use of a reagent quality sensor.(b) indirect means, such as the use of a NO x sensor in the exhaust to evaluate reagent effectiveness.(c) any other means, provided that its efficacy is at least equal to the one resulting by the use of the means ofpoints (a) or (b) and the main requirements of this section are maintained.’ANNEX IIAnnex II to Directive 97/68/EC is amended as follows:1. Section 2 of Appendix 1 is replaced by the following:POLLUTIONAIRAGAINSTTAKEN‘2. MEASURESyes/no(*)............................................................................................................gases:recyclingcrankcase2.1. Deviceforcoverednotbyheading)ifanother(ifanti-pollutiondevices2.2. Additionalandany,(*)yes/noconverter:2.2.1. Catalytic.......................................................................................................................................................................................2.2.1.1. Make(s):........................................................................................................................................................................................2.2.1.2. Type(s):converterselements................................................................................................................andcatalytic2.2.1.3. Numberofconverter(s):...............................................................................................thecatalyticofandvolume2.2.1.4. Dimensions-........................................................................................................................................................action:ofcatalytic2.2.1.5. Typeprecious........................................................................................................................................metals:of2.2.1.6. Totalchargeconcentration:...........................................................................................................................................................2.2.1.7. Relative.....................................................................................................................................material):and2.2.1.8. Substrate(structure...............................................................................................................................................................................2.2.1.9. Celldensity:2.2.1.10. Type of casing for the catalytic converter(s): .................................................................................................................2.2.1.11. Location of the catalytic converter(s) (place(s) and maximum/minimum distance(s) from engine): ............2.2.1.12. Normal operating range (K): ................................................................................................................................................2.2.1.13. Consumable reagent (where appropriate): .......................................................................................................................2.2.1.13.1. Type and concentration of reagent needed for catalytic action: .............................................................................2.2.1.13.2. Normal operational temperature range of reagent: ......................................................................................................2.2.1.13.3. International standard (where appropriate): ....................................................................................................................2.2.1.14. NO x sensor: yes/no (*)(*)yes/nosensor:2.2.2. Oxygen.......................................................................................................................................................................................2.2.2.1. Make(s):............................................................................................................................................................................................2.2.2.2. Type:.....................................................................................................................................................................................2.2.2.3. Location:(*)yes/noinjection:2.2.3. Airetc.):.........................................................................................................................................pump,2.2.3.1. Type(pulseair,air(*)yes/no2.2.4. EGR:etc.):pressure,........................................................................2.2.4.1. Characteristicspressure/low(cooled/uncooled,high(*)yes/no2.2.5. Particulatetrap:particulate.........................................................................................................thetrap:capacityof2.2.5.1. Dimensionsandparticulatetrap:.........................................................................................................................theandof2.2.5.2. Typedesignengine):..................................................................fromdistance(s)2.2.5.3. Locationand(place(s)maximum/minimumdescriptionand/ordrawing:regeneration,............................................................................ofor2.2.5.4. Methodsystempressure(kPa)and..................................................................................range:2.2.5.5. Normal(K)operatingtemperature(*)yes/nosystems:2.2.6. Otheroperation:...................................................................................................................................................and2.2.6.1. Description___________(*) Strike out what does not apply.’2. Section 2 of Appendix 3 is replaced by the following:POLLUTIONAGAINSTAIRTAKEN‘2. MEASURESyes/no(*)............................................................................................................gases:crankcase2.1. Deviceforrecyclingcoverednotbyheading)ifanotherany,anti-pollutiondevices(ifand2.2. Additional(*)yes/noconverter:2.2.1. Catalytic.......................................................................................................................................................................................2.2.1.1. Make(s):........................................................................................................................................................................................2.2.1.2. Type(s):and................................................................................................................converterselementscatalyticof2.2.1.3. Numberconverter(s):...............................................................................................thecatalyticofandvolume2.2.1.4. Dimensions-........................................................................................................................................................action:ofcatalytic2.2.1.5. Typeprecious........................................................................................................................................metals:of2.2.1.6. Totalchargeconcentration:...........................................................................................................................................................2.2.1.7. Relative.....................................................................................................................................material):and2.2.1.8. Substrate(structure...............................................................................................................................................................................2.2.1.9. Celldensity:2.2.1.10. Type of casing for the catalytic converter(s): .................................................................................................................2.2.1.11. Location of the catalytic converter(s) (place(s) and maximum/minimum distance(s) from engine): ............2.2.1.12. Normal operating range (K) .................................................................................................................................................2.2.1.13. Consumable reagent (where appropriate): .......................................................................................................................2.2.1.13.1. Type and concentration of reagent needed for catalytic action: .............................................................................2.2.1.13.2. Normal operational temperature range of reagent: ......................................................................................................2.2.1.13.3. International standard (where appropriate): ....................................................................................................................2.2.1.14. NO x sensor: yes/no (*)yes/no(*)sensor:2.2.2. Oxygen.......................................................................................................................................................................................2.2.2.1. Make(s):............................................................................................................................................................................................2.2.2.2. Type:.....................................................................................................................................................................................2.2.2.3. Location:(*)yes/noinjection:2.2.3. Airetc.):.........................................................................................................................................pump,2.2.3.1. Type(pulseair,air(*)yes/no2.2.4. EGR:etc.):pressure,........................................................................2.2.4.1. Characteristicspressure/low(cooled/uncooled,high(*)yes/no2.2.5. Particulatetrap:particulate.........................................................................................................thetrap:capacityof2.2.5.1. Dimensionsandparticulatetrap:.........................................................................................................................theandof2.2.5.2. Typedesignengine):..................................................................fromdistance(s)2.2.5.3. Locationand(place(s)maximum/minimumdescriptionand/ordrawing:regeneration,............................................................................ofor2.2.5.4. Methodsystempressure(kPa)and..................................................................................range:2.2.5.5. Normal(K)operatingtemperature(*)yes/nosystems:2.2.6. Otheroperation:...................................................................................................................................................and2.2.6.1. Description___________(*) Strike out what does not apply.’。

斑马技术公司DS8108数字扫描仪产品参考指南说明书

斑马技术公司DS8108数字扫描仪产品参考指南说明书
Chapter 1: Getting Started Introduction .................................................................................................................................... 1-1 Interfaces ....................................................................................................................................... 1-2 Unpacking ...................................................................................................................................... 1-2 Setting Up the Digital Scanner ....................................................................................................... 1-3 Installing the Interface Cable .................................................................................................... 1-3 Removing the Interface Cable .................................................................................................. 1-4 Connecting Power (if required) ................................................................................................ 1-4 Configuring the Digital Scanner ............................................................................................... 1-4

BCEncode条码动态库函数详解及破解

BCEncode条码动态库函数详解及破解
文字默认字体为OCR-B-10 BT,目前还不能改变字体名称和大小;
如条码高度太低,不足以放置可读性文字,则自动不产生可读性文字。
err:指向DWORD的指针,用于设置错误提示,返回错误信息。
如为NULL,则不显示错误提示,并且不返回错误码
否则指向的值可取下列值之一:
unsigned int nCols,
unsigned int nEccLevel,
unsigned int nRotate,
unsigned int xScale,
unsigned int yScale,
很多做ERP的人员都喜欢使用BCEncode.dll 动态库来生成一个Bmp条码文件,可是这个文件不好的是,调用MakeBarcodeBmpFile 生成一维条码BMP文件的函数,有一个提示“确认生成条码”,对于一次要生成多个文件很不方便,去掉他的提示方法是: 1、用UltraEdit以16进制方式打开文件 2、查找内容“D2 75 15 6A 30 68 90 11 01 10 68 44 11 01 10 FF 15 14 D1 00 10 50 FF D7 8B 44 24 7C” 3、修改替换为“D2 74 15 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 33 C0” 4、保存文件 这样就可以去掉提示了。
FULLASCII39 全 ASCII 39码,,可表示全部127个ASCII字符
lpszText:条码字符串
一些码制会对该字符串进行修改:
标准39码和STANDARD93码,所有小写字符会被转换成大写。
EAN13、EAN8、UPCA、UPCE最后一位将被正确的校验字符代替,且UPCE第一位被设为“0”。

Python网络爬虫验证码处理与破解技术介绍

Python网络爬虫验证码处理与破解技术介绍

Python网络爬虫验证码处理与破解技术介绍网络爬虫是一种自动化检索和提取网络信息的程序。

然而,许多网站为了防止被爬虫程序过度利用,会使用验证码来验证用户的身份。

验证码是一种人机识别技术,通过要求用户输入特定的字符或执行特定的任务来确保用户是真人而不是机器。

对于Python网络爬虫来说,与验证码的处理与破解是一个重要而复杂的技术挑战。

一、验证码的类型及特点1. 图片验证码图片验证码是最常见的一种验证码形式。

它通常由一张包含随机字符和干扰元素的图片组成。

图片验证码的特点是难以被自动识别,需要利用图像处理算法进行处理分析。

2. 数字验证码数字验证码是指只包含数字字符的验证码。

相较于图片验证码,数字验证码的处理更为简单,只需要对字符进行识别即可。

3. 滑块验证码滑块验证码是一种常见的拖动验证形式,它通过要求用户在一个特定的滑块区域内进行操作,验证用户身份。

与其他验证码相比,滑块验证码更加难以破解,因为它涉及到用户与页面的交互。

4. 点击验证码点击验证码要求用户在某个特定区域内点击特定的图标或字符,以此来验证用户身份。

点击验证码相对较难破解,因为它需要模拟用户点击行为。

二、验证码的处理方法1. 图像处理算法对于图片验证码,可以使用图像处理算法进行处理分析,提取出验证码上的字符。

常用的算法包括图像二值化、去噪、字符分割等。

通过这些算法的组合运用,可以准确提取出验证码中的字符。

2. 机器学习方法机器学习方法在验证码处理中有广泛的应用。

可以使用已标注好的验证码数据集来训练模型,通过模型的学习和分类能力来进行验证码的识别。

3. 借助第三方接口有些网站为了方便用户,提供了验证码识别的API接口。

我们可以利用这些接口来进行验证码的识别,减少自行处理的工作量。

三、验证码的破解技术1. 验证码识别库验证码识别库是解决验证码问题的一个重要工具。

例如,Python中的Tesseract OCR库就是一种非常常用的验证码识别库,它可以处理多种类型的验证码,并且具有较高的识别准确性。

逆转检事2cia文件

逆转检事2cia文件

逆转检事2cia文件介绍《逆转检事2》是一款由CAPCOM开发的法庭推理冒险游戏,是《逆转检事》系列的续作。

玩家扮演年轻的辩护律师成步堂龙一,在法庭上与检察官进行激烈的辩论,揭开真相。

本文将详细介绍《逆转检事2》中的cia文件以及逆转cia文件的过程。

什么是cia文件cia文件是3DS游戏文件的一种格式。

3DS是任天堂公司推出的一款掌上游戏机,cia文件是该游戏机上的游戏文件,可以在3DS主机上运行。

cia文件通常由游戏开发商制作,包含了游戏的所有数据和资源。

逆转cia文件的过程逆转cia文件是指将cia文件进行解密和修改的过程,使得原本无法修改的cia文件可以被修改和使用。

下面是逆转cia文件的详细过程:1. 获取cia文件首先,需要从合法渠道或其他途径获取到需要逆转的cia文件。

确保文件的完整性和合法性。

2. 安装逆转工具接下来,需要安装逆转cia文件所需的工具。

常用的逆转工具有Decrypt9、FBI等,根据具体情况选择合适的工具进行安装。

3. 解密cia文件使用逆转工具中的解密功能,将cia文件进行解密。

解密后的文件将包含游戏的所有数据和资源。

4. 修改cia文件在解密后的文件中,可以对游戏进行修改。

比如修改游戏中的角色、道具、关卡等内容,以满足个人需求或增加游戏的趣味性。

5. 重新加密cia文件修改完成后,使用逆转工具中的加密功能,将修改后的文件重新加密。

加密后的文件将恢复为cia文件格式,并可以在3DS主机上运行。

6. 安装修改后的cia文件最后,将修改后的cia文件通过逆转工具或其他安装工具,安装到3DS主机上。

安装完成后,即可在主机上运行修改后的游戏。

注意事项在逆转cia文件的过程中,需要注意以下事项:1. 合法性逆转cia文件属于对游戏进行修改和破解的行为,可能涉及到版权和法律问题。

请务必遵守相关法律法规,确保获取和使用cia文件的合法性。

2. 文件完整性在获取cia文件时,要确保文件的完整性和正确性。

安徽省安庆市2024届高三下学期模拟考试(二模)英语试卷(含答案)

安徽省安庆市2024届高三下学期模拟考试(二模)英语试卷(含答案)

安徽省安庆市2024届高三下学期模拟考试(二模)英语试卷学校:___________姓名:___________班级:___________考号:___________ 一、阅读理解Winter vacations don’t have to be about snow. From scenic coastal journeys to wildlife watching, we have found a trip for every type of winter wanderer. Here’re some hot spots.Road-trip down Oregon’s scenic coastOne of Oregon’s Seven Wonders, this 363-mile stretch of coastline is filled with landscapes, waves, headlands, and winter storms. There’s no shortage of stops on the scenic route from Astoria to Brookıng s. Visit coastal communities, spot sea lions at Shore Acres State Park, watch dancing lellyfish at the Oregon Coast Aquarıum, and explore 79 state parks.Enjoy the light show in San Antonio, TexasFrom late November to early January, millions of twinkling lights decorate the San Antonio River Walk in an eye-catching display. Riverboats carrying diverse mix of bell choirs, folk groups, and Latino bands fill the air with carols on evenings through late December.Soak in New Mexico’s natural hot springsWith more than 300 days of sunshine a year, five national forests, and 17 national parks and monuments, New Mexico is a paradise(乐园) of outdoor adventure. After an active day, loosen up your muscles in comfortable mineral springs.Celebrate New Year’s Day with t he mummers in PhiladelphiaOn New Year’s Day, thousands of brightly costumed people take to the streets of Philadelphia for the annual Mummers Parade, the oldest continuous folk parade in the U. S. The people line the streets of the City of Brotherly Love from JFK Boulevard down Broad Street to watch the mummers (哑剧演员) flood the city in an explosion of color, music, and dance.1.Where should visitors go if they want to explore coastal life?A. Oregon.B. San Antonio.C. New Mexico.D. Philadelphia.2.What is the right time for enjoying the light show?A. October 26.B. November 1.C. December 16.D. February 4.3.Where is the text most probably taken from?A. A history book.B. A travel brochure.C. A course plan.D. An art journal.The Feast of the Seven Fishes is an Italian-American tradition that dates back to animmigration (移民) wave in the 1900s. The Italian American tradition of the “Feast of the Seven Fishes” has appeared in movies and recently in the hit show The Bear. But talking of the origin, you’l l get many different answers. The Feast of the Seven Fishes is a dear tradition to many Italian Americans who enjoy at least seven different seafood dishes on Christmas Eve.A vast majority of Italian immigrants to the United States were from rural Southern Italy at the turn of the 19th century. They came to America because there were jobs from building railroads to skyscrapers. Friends and families found success and brought their loved ones tofamilies in Southern Italy. Others say the sea represented Italian Americans’ connection between their old and new homes.Writer and director Robert Tinnell made a comic in 2004 about his experience with the Feast of the Seven Fishes, which he later made into a 2019 movie. Growing up in North Central West Virginia, he fondly remembers his great grandmother organizing the Feast. After she died, his grandfather and other men in the family took over. That particular manly activity is something that the first Italian immigrants would have also performed out of necessity: men came to America first, without their wives and daughters.However, knowledge about where to shop, when to prepare, how to cook, the history behind the meal and family traditions soon became the responsibility of mothers to pass down to their daughters, says Di Giovine, a professor at West Chester University of Pennsylvania. They are also likely the ones who have the final say in making changes to recipes. Over time, families often adjust the menu to make things easier, cheaper, more abundant, and more accommodating of dietary restrictions.4.What do we know about the Feast of the Seven Fishes?A. It relates to a story of Italians.B. It’s made up of seven fishes.C. It marks a vital historic event.D. It’s about Americans in Italy.5.What does the underlined word “impoverished” in paragraph 2 probably mean?A. Needy.B. Unfortunate.C. Extended.D. Uneducated.6.What can we infer about Robert Tinnell from paragraph 3?A. He loves fishes.B. He’s an editor.C. He’s emotional.D. He teaches writing.7.What can be the best title for the text?A. A Fish-making MethodB. A Festival TraditionC. A Cookery BookD. A Special CelebrationA middle-aged woman playing by herself in the snow is an undeniably odd sight, but maybe it shouldn’t be. New research suggests that modern adults are suffering from overmuch depression, so play may be as essential to our health as sleep. We’ve been in our nature to play, which is causing all kinds of problems—for ourselves, our children, and our planet.It’s believed that adult play can lead to useful discoveries, which is supported by a study on Bali’s long-tailed monkeys. For her doctoral paper at the University of Lethbridge, animal researcher Camilla Cenni left two types of puzzle boxes for the monkeys to solve. To get the food inside, they had to drop a rock into the container or use it to hit the box. She found the monkeys that previously had been observed dropping rocks for fun were more likely to solve the rock-dropping puzzle, while those that had discovered the joy of tapping rocks together think of the answer to the tapping puzzle.This finding also suggests that somewhere, deep in our evolutionary history, a playful proto-human(原始人) came up with the concept of stone tools. Even today, the urge to play underlies most of humanity’s greatest inventions, artworks, and scientific breakthroughs, Brown says. “When I interviewed Nobel winners, I was struck by how most of them didn’t separate work and play. Their labs were their playgrounds”.“The opposite of play isn’t work; it’s depression,” says play researcher Stuart Brown, “Play is all about looking at a tough world with creativity and optimism. It gives us the ability to cooperate and ge t along with people who differ from us,” He goes so far as to declare that “adult play is necessary for our survival as a species.”The next time I’m caught playing, I know exactly what I’ll say: “I am not wasting time, or acting immature. I’m doing nothing for the benefit of all humanity. You’re welcome.”8.What is the phenomenon the author describes at the beginning of the text?A. Playing with snow is strange.B. Wild nature is difficult to find.C. Many people are stressed out.D. People enjoy living close to nature.9.What is paragraph 2 of the text mainly about?A. The necessity of the study.B. The importance of adult play.C. Main activities of monkeys.D. Various functions of a rock.10.What is the author’s purpose in mentioning a playful proto-human?A. To explain the concept of play.B. To compare two research findings.C. To highlight scientific breakthroughs.D. To offer some background information.11.Which of the following best describes the author in the last paragraph?A. Humorous.B. Optimistic.C. Caring.D. Active.Nobody knows yet what the best way of removing all that carbon will be, but scientists around the world are developing a new method. The Swiss company Climeworks is building big extractor (抽油烟机) fans to remove carbon.But other scientists are looking to nature’s carbon cycle for inspiration. They’re looking for ways to improve it, speed it up and help it take more carbon out of the air permanently.One of those scientists is Professor Luke Mackinder, a plant biologist at the University of York. His research into carbon removal is inspired by ocean algac (海藻). “About half of carbon absorption takes place in the ocean,” he says. “Algae are extremely efficient at absorbin g it.”In order to do this, his team has studied the genetic code (基因密码) of algae to work out which genes play a vital role in carbon absorption. He believes they have now figured this out. “Now we have a list and we can start thinking about how to bring them together in different living things,” he says. “We place the genes into those of other plants. It’s genetic modification.”Mackinder anticipates adding them to a range of crops and trees. The resulting increased production could be good for food security. Alternatively, they could help to enhance the in fluence of climate change. It all depends on what we do with the carbon once it’s trapped in those plants. Eating them would quickly return it to the atmosphere. But if instead we find ways to store it, we could keep it out of the atmosphere for good.Dave Hillyard, chief administrator of the Carbon Technology Research Foundation that is funding Mackinder’s research, says that it is important to fund work on a wide range of carbon removal methods, because “some will not get the results they’re looking for a nd some will succeed. There are a lot of opportunities here but very little funding and research going into it.”12.What is discussed in the first paragraph?A. An approach to carbon removal.B. A way to improve big extractor fans.C. A means of joining a company.D. A method of doing scientific research.13.Why does Professor Luke Mackinder focus on ocean algae?A. It is secure.B. It is effective.C. It is sufficient.D. It is accessible.14.What can we know about the genes of algae from the fourth paragraph?A. They bring about great side effects.B. They are useless for carbon absorption.C. They help increase food production.D. They have been put into other plants.15.What is required according to Dave Hillyard?A. The government’s permission.B. More scientists’participation.C. Increasing experimental chances.D. The input into the research.二、七选五16.How to Make Your Clothes Last LongerWe have to throw out some clothes that we love just because we’ve not taken good care of them. Four top tips can help you make your clothes last longer. ① _________●Reduce the times you wash your clothes. Washing your clothes less doesn’t mean wearing the same T-shirt tor a week. You can wear clothes like jeans and jumpers at least three times before washing. The exception, of course, is clothes worn for the gym. Besides, if you don’t wear clothes next to your skin, air them after wearing.② _________ If they seem fine, you can wear them another day.●Wash, our clothes inside out.③ _________ As the machine spins (旋转) the clothes around, they must each other. Turning your clothes inside out reduces wear on the outside surface of your clothes: This can help keep them from damage.●Air your clothes dry if possible. Drying your clothes on a line is good for both your clothes and he environment. ④_________ When possible, just use the dryer at a low temperature.●⑤_________ Rather than throw something out because of a small hole or tear. Knowing how to use a needle and thread (线) and a few basic repairing techniques can be friendly to your clothes and your pocket. If the work is beyond your skills, you can find repair places nearby your houses.A. Hang your jumpers on the clothes line.B. Fixing your clothes is a wise alternative.C. Use an app to find places for clothes repair.D. Simply check your clothes for any spots or marks.E. Your clothes are usually beaten hard during the wash.F. In the meantime, it can also reduce the expense of the electricity.G. They can also help save both your money and our environment definitely.三、完形填空(15空)My two-year-old daughter was playing with groceries in my shopping cart (购物车). Aloan of that amount.17.A. toys B. bags C. items D. dollars18.A. behaving B. studying C. eating D. resting19.A. panic B. hurry C. mess D. mood20.A. failed B. offered C. agreed D. promised21.A. patiently B. constantly C. appreciatively D. eventually22.A. respect B. confidence C. determination D. pleasure23.A. unloading B. unfolding C. unwrapping D. uncovering24.A. ached B. broke C. beat D. sank25.A. picking up B. looking over C. handing out D. giving away26.A. purse B. card C. daughter D. stuff27.A. annoyed B. discouraged C. confused D. astonished28.A. hesitated B. panicked C. regretted D. rejected29.A. confirmed B. joked C. smiled D. insisted30.A. remembered B. feared C. experienced D. shared31.A. trust B. praise C. thank D. reward四、短文填空32.Cross-bridge noodles is the name of a special dish originating from Yunnan Province. The dish① _________ (make) of stewed chicken or goose soup, slices of pork or fish, vegetables and rice noodles.There’s a story behind the②_________ (origin) creation of cross-bridge noodles. It’s said that there was③_________ scholar during the Qing Dynasty④_________ (study) every day on an island of Mengzi City in Yunnan. His favorite food was rice noodles, and his wife brought him a serving of them every day at his office. ⑤_________ she was disappointed when she realized the noodles would get cold on the way to the island.One day she realized that when she took her husband chicken soup it stayed warm during the trip. She figured out that the oil layer on top of the soup separated it from the cold and⑥_________ (keep) the heat inside.The wife then came up with a⑦ _________ (solve). She tried bringing the chicken soup, rice noodles and other ingredients to the island⑧_________ (respective), then combining them. The dish became known⑨ _________ “cross-bridge noodles” in memory of the wife ⑩ _________ discovered a dish that would stay warm as she crossed the bridge to the island every day.五、书面表达33.假定你是李华,下周你校将举行“科普进校园”活动,请你给外教Eleanor写封邮件邀请她参加。

concurrentdictionary转换字符串 -回复

concurrentdictionary转换字符串 -回复

concurrentdictionary转换字符串-回复ConcurrentDictionary是一个在多线程环境下安全的哈希表数据结构。

它提供了一种方便且高效的方式来存储和访问键值对。

本文将以"concurrentdictionary转换字符串"作为主题,逐步介绍如何使用ConcurrentDictionary来实现这一功能。

在开始之前,我们先来了解一下ConcurrentDictionary的基本概念和用法。

ConcurrentDictionary是一个线程安全的字典类,它能够在多个线程同时进行读写操作而不会引发竞态条件或死锁。

它是在.NET Framework 3.5中引入的,并在之后的版本中继续进行改进和优化。

接下来,我们来看一下如何使用ConcurrentDictionary来实现将其转换为字符串的功能。

首先,我们需要定义一个ConcurrentDictionary对象,并添加一些键值对。

例如,我们可以定义一个ConcurrentDictionary来存储学生的姓名和年龄信息。

csharpConcurrentDictionary<string, int> studentDictionary = new ConcurrentDictionary<string, int>();studentDictionary.TryAdd("Alice", 18);studentDictionary.TryAdd("Bob", 20);studentDictionary.TryAdd("Charlie", 19);studentDictionary.TryAdd("David", 21);上述代码创建了一个ConcurrentDictionary对象,并向其中添加了四个键值对。

现在,我们可以通过遍历ConcurrentDictionary对象的方式将其转换为字符串。

vscode提取方法

vscode提取方法

vscode提取方法
1.打开VSCode,打开要提取的代码文件。

2. 选中要提取的代码段,并右击,选择“Refactor” -> “Extract Method”。

3. 在弹出的窗口中输入新方法的名称,并选择新方法要放置的位置。

4. 点击“Extract”按钮,即可完成代码提取。

5. 在新方法中添加参数,根据需要传递参数。

6. 在原来的代码中调用新方法即可。

注意事项:
1. 方法提取后,要保证新方法的可重用性和代码的可读性。

2. 提取代码前,要先思考是否有必要提取,以及提取后是否对整个代码结构有影响。

3. 建议在方法提取前,先进行代码备份,以防操作失误造成代码丢失。

- 1 -。

calcite unicode编码

calcite unicode编码

Calcite是一个开源的、动态的数据管理框架,它并不直接涉及Unicode编码的处理。

Unicode是一种字符编码标准,用于统一表示各种语言的字符。

然而,Calcite在处理数据时,可以处理包含Unicode字符的数据。

当使用Calcite进行数据查询、转换或处理时,你可以将数据中的Unicode字符作为普通字符处理。

Calcite支持多种数据源和查询语言,包括SQL,因此你可以使用SQL 查询来检索和处理包含Unicode字符的数据。

如果你在使用Calcite时遇到Unicode编码的问题,可能是数据源或查询中的字符编码与你的环境或期望不符。

在这种情况下,你可能需要确保数据源使用正确的Unicode编码,或者在查询或处理数据之前对数据进行适当的编码转换。

总之,Calcite本身不直接处理Unicode编码,但你可以使用它来查询和处理包含Unicode字符的数据。

如果遇到编码问题,你可能需要关注数据源和查询的编码设置。

为啥要编译源代码文件

为啥要编译源代码文件

为啥要编译源代码文件
讲解对象:为啥要编译源代码文件
作者:融水公子 rsgz
1 为啥要编译源代码
"这一段代码是提供给人类阅读的
"计算机只会识别0和1这两个逻辑值
"电路只会用0和1这两个逻辑值表示不同的物理状态
"可以通过某种规则将代码转化翻译为01 "这个翻译的过程取就是编译
"编译之后就会有一个可执行文件
"可执行文件用后缀名就是.exe
" .exe和.out都是可执行文件,
" .exe是属于Windows的, .out是属于Linux系统的
2 编译C文件
" (菜单栏)execute-->Compile&Run
"会弹出一个窗口,显示程序运行的结果Hello,World!
"只要你细心,基本上都会出现正确的结果的
"出错了,肯定是你字母大小写,缺少字母,或者符号,空格写错了!
3 保存程序
" File--->Save 或者Ctrl+S
"保存的地址随便吧,开心就好
"文件名的后缀名是默认的是.cpp
" .cpp表示C++的文件
" .c表示C文件
"将文件后缀名改成.c
4 设置字体样式
" Tools-->Editor-->options--->font
"字体设置
" [size是尺寸 colors是颜色 ]
"字体设置大一点好看一点。

C#中的字符串及其编码转换

C#中的字符串及其编码转换

C#中的字符串及其编码转换
关于字符编码以及如何在程序中处理unicode,本想写篇⽂章总结学习⼀下,但发现有前⼈已经论述的很完善了,不再重复,可以参考:。

在C++中,字符有char和wchar之分,相应的,字符串有string和wstring两种。

C#中,string是⼀个unicode字符串,相应的,每个char都是16位。

源⽂件中出现的字符串常量,都会被⾃动转换为unicode编码(utf16),利⽤Text.Encoding,可以实现不同编码间的转换。

using System;
using System.Text;
namespace test
{
class Program
{
static void Main(string[] args)
{
string u16s = "忘记了啊abc"; //默认的字符编码是unicode,也就是utf16
//4种编码
Encoding utf8 = Encoding.UTF8;
Encoding utf16 = Encoding.Unicode;
Encoding gb = Encoding.GetEncoding("gbk");
Encoding b5 = Encoding.GetEncoding("big5");
//转换得到4种编码的字节流
byte[] u16bytes = u
}
}
}。

VC函数含义及编码转换

VC函数含义及编码转换

VC函数含义及编码转换字符串有好几种不同的类型,新手一开始学的一定是char,这种是最基础的字符串,用ASCII码来表示英文,这个叫做ANSI编码。

现在新写程序都应当使用宽字符,类型是wchar_t,一个wchar_t占两个字节,不管英文还是中文,这种编码是一种Unicode编码,Unicode编码的程序即使拿到其他语言的系统上运行也能正确显示,前提是那个系统安装了中文字体。

还有一种是MBCS,翻译成中文就是多字节字符串,一个字符有多个字节组成,不一定是2字节也可以多余两字节,GB2312,UTF8等都属此类。

编译器是不能自动转换char和wchar_t的,因为他们之间的转换必须要指定代码页。

微软提供了一系列的函数来对应操作这些字符串,你只要在msdn搜一个strlen,他下面会列出比如wstrlen,w开头的用来操作wchar_t,mb开通的用来操作MBCS等。

值得一提的是一组_t开头的,这是一种“自适应”的函数,在Visual Studio的工程选项里面可以选择应用程序编码使用Unicode还是普通的,那么这个_t就会自动适应这个选项,比如_tcslen在选项为Unicode的时候自动执行wstrlen,在选项为ANSI编码的时候执行strlen。

再说一下Windows API有关字符串类型的定义,常见的有这么几个#define LPSTR char*#define LPCSTR const char*#define LPTSTR TCHAR*#define LPCTSTR const TCHAR*#define LPWSTR wchar_t*#define LPCWSTR const wchar_t*你仔细看一下就找到了规律,LP是指针,微软的传统,STR表示字符串,C表示const,T表示TCHAR,W表示wchar_t。

最后说一下TCHAR,TCHAR和前面说的_tcslen有一样的作用,他是这么定义的#ifdef _UNICODE#define TCHAR wchar_t#else#define TCHAR char#endif也就是根据编译器的自动适应。

再生码(Regenerating Codes)开山之作

再生码(Regenerating Codes)开山之作
站在这个观点上,我们引入一个新方案,再生码(Regenerating Codes),它在我们坚持 MDS 的“对称性”下最小化一个新手需要下载的数据量。在更高的层次上,RC 方案通过新手保存所有 下载得到的数据来改进 OMMDS,而不是将这些数据扔掉。结果就是 RC 码会有比 MDS 更大的 分片,但却只需要很少的维持带宽开销,即使新手之和 k 个节点交互。比如 k = 7,一个新手只 需要下载 0.16M bytes 数据 —比 OMMDS 减少了 39%,比初始策略减少了 84%。更进一步,我 们的在基于真实分布式系统测量得到的节点可靠性模拟实验中指出,在 k = 7 时,RC 较混合策 略减少了 25% 的带宽。随着 k 增大 RC 性能更好。
考虑存储方案的动态特性,信息流图也随着时间变化。在任意时间,图上的每个顶点要么是 活跃的,要么是非活跃的,取决于该节点在网络中是否可用。在初始阶段,只有源节点是可用的。 它紧接着和一系列初始存储节点交互,连接他们的输入节点(xin),这条边的权重为无限大。从 这点开始,原始节点 S 变成并保持不活跃状态。在下一时间点,开始选中的存储节点变为活跃状 态;他们代表一个分布式纠错码,对应着我们希望的系统稳定状态。如果一个新的节点(译注: 新手)j 加入到系统,它只能和系统中活跃的节点进行交互。如果一个新手 j 选择和活跃的存储 节点 i 进行连接,那么我们就添加一条有向边从 xouti 到 xinj ,边权重等于新手从节点 i 下载的 数据量。注意到一般新手下载的数据量是要多于他们所存储的,比如在(14,7)-纠错码中。如果 一个节点离开了系统,就变为不活跃状态。最后,一个数据收集器 DC 对应的是发起请求重建数 据的节点。数据收集器连接所有活跃节点的一个子集,边权重为无限大。
Rodrigues 和 Liskov [20] 得到了不同的结论:在高扰动(high-churn,节点失效率高)环境中, 纠错码具有更大的优势,但是带宽代价太高以至于根本不适合 P2P 分布式存储系统。在低扰动环 境中,带宽的减少是微不足道的。在中毒扰动环境中,有一些好处,但是这点优势可能也被纠错 码带来的系统复杂度所动摇。这些结论都是基于一个分析模型,通过放大真实系统的 traces 中评 估的系数得到的。相对于 [28],[20] 使用了更小的 k 值(7 而不是 32 )和混合策略来指出码的重 建],[18],[7],[21],[2],[27] 设计和评估了大规模,P2P 分布式存储系统。这些 系统中冗余管理策略已经在 [28],[3],[2],[20],[27],[5],[25],[11] 进行了评估。

Codewarrior License制作教程(优选.)

Codewarrior License制作教程(优选.)

目录第1章 Codewarrior License制作教程 (1)1.1 准备工作 (1)1.2 制作步骤 (1)1.2.1 确定FlexLm版本号 (1)1.2.2 找FEATURE (2)1.2.3 找vendor (5)1.2.4 找计算seed的关键数据 (6)1.2.5 计算ENCRYPTION_SEED (8)1.2.6 制作License生成器 (9)1.2.7 生成License (9)第1章Codewarrior License制作教程声明作者出于学习的目的撰写此文,读者需承担文章使用或传播过程中产生的一切后果,作者概不负责。

我们以飞思卡尔Codewarrior for HC08 v6.0为例,来介绍制作过程。

1.1 准备工作我们需要事先准备如下软件:z Lmtoolsz OllyICEz Calcseedz Lmcryptgui1.2 制作步骤破解Flexlm最主要的是找到4样东西:z确定Flexlm版本号z找FEATUREz找vendorz计算ENCRYPTION_SEED1.2.1确定FlexLm版本号运行Lmtools,选择Utilities标签页,点击Browse选择Codewarrior安装目录bin目录下lmgr8c.dll,然后点击Find Version,如图 1.1。

图 1.1 确定Flexlm版本号1.2.2找FEATURE运行OllyICE,界面如图 1.2。

图 1.2 OllyICE运行界面点击“文件/打开”,选择Codewarrior安装目录bin目录下IDE.exe,界面如图 1.3。

图 1.3 打开IDE.exe界面在反汇编窗口中点击右键,选择“查看”,打开模块‘LMGR8C’,如图 1.4。

图 1.4 打开模块‘LMGR8C’在反汇编窗口中点击右键,选择“查找”,打开“所有参考文本字串”,如图 1.5。

图 1.5 打开所有参考文本字串在参考文本字串窗口中点击右键,选择“查找文本”,输入“lm_ckout.c”,进行查找。

c语言解压缩文件代码

c语言解压缩文件代码

c语言解压缩文件代码C语言是一种广泛应用于系统编程和嵌入式开发的高级编程语言,具有高效性和灵活性。

在C语言中,我们可以用代码实现很多功能,包括解压缩文件。

解压缩文件是指将经过压缩的文件恢复成原始文件的过程。

在计算机中,常见的压缩文件格式有zip、rar、gzip等。

这些压缩文件通常是为了减小文件的体积以便于传输和存储而产生的。

而解压缩文件的过程就是将这些压缩文件恢复成原始文件的过程。

在C语言中,我们可以使用第三方库来实现解压缩文件的功能。

其中,常用的库有zlib和minizip。

这些库提供了压缩和解压缩文件的函数和接口,可以方便地在C语言中进行文件解压缩的操作。

我们需要在C语言中包含相关的头文件。

对于zlib库,我们需要包含<zlib.h>头文件;对于minizip库,我们需要包含<unzip.h>头文件。

接下来,我们需要定义一些变量来保存压缩文件和解压缩文件的路径。

通常情况下,我们可以将压缩文件的路径和解压缩文件的路径定义为字符串类型的变量。

然后,我们需要打开压缩文件。

在C语言中,我们可以使用fopen 函数来打开文件。

通过使用fopen函数,我们可以获得一个指向文件的指针,以便后续的操作。

在打开压缩文件之后,我们可以使用相关的函数来解压缩文件。

对于zlib库,我们可以使用gzopen函数打开压缩文件,然后使用gzread函数从压缩文件中读取数据,最后使用gzclose函数关闭压缩文件。

对于minizip库,我们可以使用unzOpen函数打开压缩文件,然后使用unzReadCurrentFile函数从压缩文件中读取数据,最后使用unzClose函数关闭压缩文件。

在解压缩文件的过程中,我们需要将解压缩的数据写入到指定的文件中。

在C语言中,我们可以使用fwrite函数将数据写入到文件中。

通过使用fwrite函数,我们可以指定要写入的数据、数据的大小和要写入的文件的指针。

在完成解压缩文件的操作之后,我们需要关闭相关的文件和资源。

使用Reflector反编译并提取源代码

使用Reflector反编译并提取源代码
最后点击Close即可 4. 左侧选中需要提取源代码的程序集,执行Tools→File Disassembler
设置好输出博客园 用户登录 代码改变世界 密码登录 短信登录 忘记登录用户名 忘记密码 记住我 登录 第三方登录/注册 没有账户, 立即注册
使用 Reflector反编译并提取源代码
Reflector是一个强大的.net 反编译工具,有时我们不止需要反编译源代码,更需要提取源代码。 Reflector本身不自带提取源代码功能,不过可以借助插件Reflector.FileDisassembler来提取源代码,方法如下: 1. 下载并安装Reflector,安装完成后打开Reflector 2. 下载插件,默认是下载一个压缩包,解压得到Reflector.FileDisassembler.dll 3. Reflector中添加插件
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

C-REX:An Evolutionary Code Extractor for C Ahmed E.Hassan and Richard C.HoltSoftware Architecture Group(SWAG)School of Computer ScienceUniversity of WaterlooWaterloo,Canada{aeehassa,holt}@plg.uwaterloo.caABSTRACTSoftware systems are continuously changing and evolving. However,the source code change process as software sys-tems adapt to customer’s evolving requirements is not well understood.Source control systems record changes to the source code of a software system.These recorded details could be used to gain some insight into the evolutionary pro-cess followed by the source code.In this paper,we discuss C-REX,an evolutionary code ex-tractor,which we developed to recover information from source control repositories to study source code evolution. We present our design choices for C-REX,explain our rea-soning for these choices,and give an overview of our ex-traction approach.We also overview a number of the limi-tations of our approach.We believe that the discussion pre-sented here is beneficial for others interested in recovering and studying data stored in source control repositories.1INTRODUCTIONSource code encodes the functionality of the software sys-tem in terms of modules and source code entities(such as functions and objects)which interact to implement the var-ious features of a software system.Throughout the lifetime of the software system,the source code evolves to implement various features and satisfy the needs of its users.To gain a better understanding of the current state of the soft-ware system,we should study the history of changes to its source code.The evolution of the source code due to the changes that occur to it throughout its lifetime can assist soft-ware developers and researchers in building better software systems.Moreover,the history of changes could be used to measure the effectiveness of development tools and to build better tools more suited to the types of challenges and diffi-culties faced by developers working on large software sys-tems.This history can also be used to determine the ben-efits of adopting different development techniques and ap-proaches[1].For example,we can use the history of source code changes to study change propagation in software sys-tems.As developers change software entities such as func-tions or variables to introduce new features orfix bugs,they must propagate the effects of these changes to other enti-ties in the software system.For example,if the interface of a function changes,its callers have to be modified to reflect the new interface otherwise the source code won’t compile nor link.This example of propagation is easy to determine,that is not always the case.Many hard tofind bugs are introduced by developers who did not notice dependencies between en-tities,and failed to propagate changes correctly.To investigate if there are good indicators such as call graph relations that could assist a developer in determining other entities to change,we could propose several change propa-gation heuristics and study the performance of each heuristic using old changes to software systems.To perform such a study we would need a good record of the dependency struc-ture of the software system throughout its lifetime.Further-more,we would need to track changes that occur to the en-tities of the source code and the dependencies among them. Using this information we would know for any given time in the past the dependencies in the software system and could thereby determine if these dependencies or other factors can explain the propagation of change.Luckily,most large software systems use source control sys-tems such as CVS and Perforce[16].These source con-trol systems help coordinate development between the mem-bers of a development team.These systems track changes to the source code over time and can resolve change con-flicts.Therefore developers do not have to worry about their changes being lost as the source control system will recon-cile changes made simultaneously by developers working on the same parts of the source code.Source control systems store a full record of all changes to eachfile in the system.Developers can at any time retrieve older versions of the code.Older versions of the code can be studied to get a clearer understanding of the current state of the system.Also in some cases developers may choose to revert back to one of these older versions as they discover that their current version is inappropriate or is too complex to maintain or understand.Source control systems attach to each change additional in-formation concerning the change such as the name of the developer performing the change,the date the change was performed,and a detailed message describing the change. Unfortunately,source control systems usually treat source code as simple text,instead of tracking changes to the codeat the level of functions,data types,and dependencies among them.Source control systems track changes at the level of lines changed.For example,the source control system would record that line number four offilefilename.c was deleted,instead of recording that a line was removed from function main(),or that function main()no longer calls func-tion printf()to be more specific.To use of this change information to study the evolution of source code and understand various development ideas such as change propagations,we need to recover this information from the source control systems and transform it.Whereas, source control systems record changes at thefile level,our goal is to record changes at the source code entity level(func-tion,macro,variable,or data type definition).Then we can track details such as:•Addition,removal,or modification of a source code en-tity.For example,adding or removing a function.•Changes to dependencies between the modified entities and other source code entities.For example,we can de-termine that a function no longer uses a specific variable or that a function now calls another function.Using this derived information we associate with each source code change other changes that occurred in otherfiles.We also know the static dependencies between source code en-tities at the moment in time when a particular change oc-curred.Furthermore,we have a record of previous entities that changed with the changed entity.This paper presents the C-REX and the rationale for its de-sign along with various issues and limitations we faced dur-ing its implementation.C-REX is an extractor which we developed to recover evolutionary information from source control repositories for software systems written in the C programming language.Organization of PaperThe paper is organized as follows.In Section2,we give an overview of evolutionary code extractors and discuss the de-cision choices we settled on as we built C-REX.In Section3 we explain the complexities and challenges associated with building C-REX.In Section4we document the schema of the data recovered by C-REX.Section5gives an overview of the implementation of C-REX and highlights a number of techniques used to speed up the extraction process.Then in Section6we overview some of the limitations and possible improvements of our approach.Section7discusses related work.In Section8we conclude the paper with comments about evolutionary extractors and their benefits for study-ing software systems and validating our understanding of the development process of large software systems.We also present possible extensions and future directions for C-REX. 2EVOLUTIONARY CODE EXTRACTORSIn[13],we introduced the concept of an evolutionary code extractor.We showed that a change to source code can bedescribed in a number of ways each one focusing on a par-ticular characteristic of the source code at varying levels of details.For example,a change to afile can be recorded as a change to the lines of thefile,to certain functions that reside in thefile,or to dependencies between these functions.For our purposes we call traditional extractors,such as rigi-parse[14],CIA[2],and CPPX[4],snapshot extractors.A snapshot extractor is retrieves information about a single version of the software system.It would produce facts such as function1calls function2,or function1uses variable1.On the other hand an evolutionary extractor retrieves infor-mation about the history or evolution of a software system over the periods of its development.This includes determin-ing changes to the source code that occur between the various snapshots.An evolutionary extractor determines the differ-ence between consecutive snapshots of the software system and produces information such as function1no longer calls function2,function1now uses variable1.C-REX is an evolutionary extractor which tracks the evolu-tion of source code using the data stored in source control system.Figure1:Conceptual View of the C-REX Extractors The C-REX extractor can be thought of as the application of a traditional snapshot extractor on each snapshot of the source code.The traditional(non-evolutionary)code extrac-tor generates information about the defined entities in the source code and the dependencies between them.For ex-ample,the snapshot extractor might report that in snapshot S1functions main(),print(),and help()are defined.It might also report that function main()calls function help() which calls function print().The same snapshot extractor applied on snapshot S2might report that functions main() and help()are defined.It might also report that main()calls help().The details for each snapshot are stored in the cor-responding snapshot facts database.Once analysis is per-formed for each snapshot,we compare every two consecu-tive snapshots(as shown in Figure1)to generate the evolu-tionary change data.Continuing our previous example,this 2snapshot extraction analysis would generate the following information when comparing snapshots S 1and S 2:function print ()was removed and function help ()no longer calls function print ().In [13],we discussed a number of design dimensions that must be examined before one proceeds to build an an evo-lutionary extractor.Choices along these dimensions influ-ence the type of information generated by an evolutionary extractor and influence the design of such an extractor.We now summarize these dimensions,elaborate on our choices,and discuss the C-REX implementation challenges associ-ated with these choices:Frequency of SnapshotsThis dimension deals with how frequently should the evolu-tionary extractor recover changes from the source code.Fig-ure 2shows the various possibility for the frequency of snap-shots.The evolutionary extractor can compare and report differences between two consecutive releases or builds.The extractor could also report differences between consecutive code changes done by a developer.Or it can track changes between a list of changes (changelist )that a developer per-formed to implement a particular feature,enhance it,or fix a bug.ChangeChangeListBuildReleaseMostLess CodeCodeFigure 2:Source Code Snapshot Frequency Choices For C-REX we chose to have the extractor track the source code at the changelist level.The choice to use the changelist level is due to the type of analysis we plan on performing on the extracted data,such as change propagation.Due to the large number of changes (hundreds of thousands of changes)that occur to the source code throughout its life-time we had to develop several techniques to perform the extraction at this frequency level in a reasonable time.These techniques are presented in more detail in Section 5.In par-ticular,the conceptualization which assumes that each snap-shot of the source code is analyzed fully then the snapshot facts are not compared is not a practical one as it would take a long time to recover the evolution of a large long lived soft-ware system.Data SourceThis dimension deals with the data source used to acquire the snapshots.Modification records stored by source control systems are a good source of changelist information.Unfor-tunately,using changelists increases the complexity of our analysis.Figure 2illustrates that more frequent snapshots are likely not to be compliable.As a software system evolves,there are many periods throughout its lifetime where the code stored in the sourcecontrol is incomplete,i.e.not compilable or parsable.For example,a developer may add calls to a function that is not yet defined or remove the definition of a function without modifying all the functions that used to call it.Therefore we have to deal with the complexity of analyzing code that is not compliable and source code entities such as functions may depend on other entities that are not yet de-fined,in contrast to using snapshots which are based on the released source code.It release snapshots or other less fre-quent snapshot the code is more likely to be compilable.The Characteristics of CodeThis dimension deals with the characteristics that are used to compare consecutive snapshots.An evolutionary source code extractor focuses on monitoring a set of characteris-tics of the source code throughout its lifetime.It compares consecutive snapshots and reports differences among them in respect to these characteristics.These characteristics can be metrics such as the size of the source code or structural ones such as dependencies between source code entities.C-REX monitors and outputs details about the structural changes to the source code.In particular,it tracks the addition,removal,and modification of source code entities,such as functions,macros,and variables.It also tracks the addition and removal of dependencies among these code ing such recovered information,we can study the evolution of source code dependencies and rea-son about different types of maintenance changes such as refactoring and renaming.For example,if C-REX reports that in one changelist all callers to function f()no longer call it,instead they call another function newF(),function f()is removed,and function newF()has been added,we can rea-son with confidence that function f()has been renamed to newF().Level of DetailThis dimension deals with the level of detail for the in-formation recovered by C-REX.The level of detail defines the granularity of code characteristics which are tracked and studied in the analysis of snapshots.Figure 3shows the var-ious levels of detail and points out that the complexity of analysis rises with increased details in the output.Code EntityFile/ClassSubsystemSystemMost Least AnalyzeAnalyzeASTFigure 3:Level of Detail for Evolutionary Analysis For example,an evolutionary extractor could track changes at the level of the whole system (such as changes to the size of the whole system),or it could instead pinpoint changes to the software system entities (changes to particular func-tions).To obtain the maximum amount of information about the evolution of a software system,we would prefer that an3evolutionary extractor recovers highly detailed information. This could entail tracking changes to the source code at the Abstract Syntax Tree(AST)level.Unfortunately,such an approach is complex to implement.An AST evolutionary analysis done per changelist snapshot needs to deal with ex-tracting incomplete code.This requires many advanced tech-niques and heuristics to recover from potential errors in such code.Therefore to avoid dealing with such complexities,we chose to have C-REX generate data at the Code Entity level. This level of detail permits us to develop snapshot extrac-tors which more robust and which use simpler error recovery techniques than ones needed for AST level analysis.With our choices along the design dimensions of an evolu-tionary extractors presented,we will now deal with some of the challenges and complexities associated with building such an extractor.3CHALLENGES IN DEVELOPING C-REX Analyzing source code,in particular source code for legacy systems,is a hard task.Performing the analysis using tools that are based on text book grammars is susceptible to fail-ure.Tools based on text book grammars fail to address the variety of dialects of programming languages and the multi-tude of proprietary compilers extensions.These tools are not capable of reliably processing the legacy source code.They require user intervention to modify the offending source code and restart the tool.For an evolutionary extractor such as C-REX,we need to parse hundreds of thousands of variants of the source code.Therefore C-REX should be able to parse legacy source code without failing,and it should recover in a graceful manner when it processes incomplete source code containing errors.In[13],we listed challenges associated with developing evo-lutionary extractors.They include:1.Robustness and scalability of the extractor2.Accuracy of the extracted information3.Changing and unstable nature of source code over time4.Time required to develop the parserWe now explain how C-REX deals with these challenges. Robustness and Scalability of the ExtractorAs we started to develop C-REX we decided that the ro-bustness and scalability of C-REX are paramount for our re-search purposes,as we planned to analyze the evolutionary history of several large long lived software projects.There-fore,we needed an extractor that is able to deal with large data sets and that is able to recover gracefully from errors. Accuracy of the Extracted InformationWe acknowledged that ensuring the robustness of C-REX will affect our accuracy and we sought to minimize this neg-ative outcome by focusing on the code entity detail level in-stead of on the AST detail level.The Changing and Unstable Nature of Source CodeAs for the changing and unstable nature of source code over time,we decided to search for techniques that can parse in-complete source code.A number of approaches exist to ana-lyze source code such as lexical analysis,robust parsing and island grammars[18].C-REX uses a lightweight extraction technique to robustly analyze incomplete source code for several snapshots.The used technique aims to only locate the start and end of each entity(such as functions,macros,and types)in the source code.By only focusing on the start and end of an entity,we can recover from non compilable code gracefully and still be able to analyze the rest of thefile.Once we locate the start and end of each entity we can perform simple string matching to determine if a particular source code entity de-pends on another entity.For example,if afile contained two functions(main and help)and we located the start and end of each functions,we can determine the tokens which reside in both functions.Then we can easily determine if function main has a token in it named‘help’or if function help has a token in it named‘main’.Several enhancements are required to ensure that the results of this approach are reasonably re-liable.For example,we ignore tokens inside of strings and comment blocks.Time Required to Develop the ExtractorTo speed up the time required to develop C-REX,we adopted an open source program called ctags[5].ctags is a source code tagger which is used by source code editors to parse the source code being ing ctags,editors can offer rudimentary source code highlighting and can pro-vide some navigational support for developers(such as mov-ing between function definitions).We believe that the chal-lenges associated with parsing source code while it is being modified by a developer inside an editor are similar to the challenges we have to tackle to parse source code which may not be compilable.By adopting ctags we do not need to consider a large num-ber of peculiarities of legacy source code.For example,we do not need to worry about ANSI and K&R C differences in the source code.ctags uses several heuristics to reli-ably parse source code containing#if preprocessor condi-tional constructs.ctags uses a conditional path selection heuristic to resolve complicated choices.It also employs a fall-back strategy when all heuristics fail.ctags has been highly optimized and can parse and tag source code very quickly and efficiently.This is an im-portant consideration given the amount of source code that we need to analyze.In addition,ctags offers support for over thirty languages.We hope in the future to use ctags multi-lingual support to extend C-REX to deal with repos-itories which contain source code written in programming languages other than C.4Additional ChallengesMore challenges became clear to us as we started working on C-REX.These challenges are mainly due to the design choices we picked for C-REX.In this subsection we present these additional challenges and discuss the techniques we used to overcome them.Acquiring Source Control Repositories to Study(Guinea Pigs)As we use source control repositories as the data source of C-REX,we needed a number of source code repositories for large projects to test C-REX and to verify that our approach could scale to analyze large software systems.We call these these repositories Guinea Pigs.We acquired the source control repositories for several projects,thanks to the availability of open source projects. Open source projects keep their repositories accessible on-line to permit developers around the world to contribute to their project.To acquire these large data sets for our studies, we used four different techniques:1.We asked the developers of some projects for accessto their source control repositories.We acquired local copies of the repositories to avoid taxing the project’s servers during our analysis and development.2.Several projects offered support for CVSup[6]–a toolused to mirror source control repositories.For these projects,we used a CVSup client to acquire our own copy of the source code repository.3.Other projects offered support for rsync[17]–a pro-tocol use to mirror data repositories.We used an rsync client to mirror the source control repositories for these projects.4.Finally for projects that offered none of the aforemen-tioned options and their development team was inacces-sible,we used CVSsuck–a tool which uses the CVS protocol itself to mirror the CVS repository.The CVS protocol which is not designed for mirroring,therefore CVSsuck is not efficient.We used CVSsuck as a last resort to acquire a repository due to its inefficiency. These Guinea Pigs permitted us to discover andfix many limitations in C-REX.Creation of ChangeListsAs C-REX uses changelist snapshots to track changes to the source code,we needed to get a record of all the changelists in source control modification records.A changelist groups several consecutive changes to a software system as part of a bigger focused change to implement or enhance a particular feature in the system,orfix a bug in it.For example,a de-veloper might change fourfiles to implement a specific fea-ture.Then the changelist would contain details for changes in each of these fourfiles,as the developer will submit all four changes simultaneously(or at least within a few min-utes apart of each other)to the source control system.Some source control systems such as Perforce store the fact thatthese four changes are related whereas other source control systems such as CVS do not keep track of such information.Therefore for CVS we needed to develop heuristics to recre-ate this grouping from CVS modification records.An effec-tive heuristic used by C-REX and Zimmermann et.al[20]is to group changes in the same changelist if they occur withina short window of time by the same developer.Enriching the Recovered Change DataSource control systems store in each modification record im-portant information other than just the changes to the source code.For each modification,the source control system stores:1.The name of the developer who performed the change,2.The time the change was performed,and3.An explanation message entered by the developer giv-ing the reason for the change.We decided to enrich our extracted data and attach this addi-tional information to it.This additional information could be helpful in understanding and explaining the recorded changes,as we have shown in our previous work(e.g.[11, 12]).To attach the additional information to the extracted data,we first perform heuristic analysis to determine the developer ofa change.Although source control systems store the name ofthe developer who submitted a change to the repository,this name may not be the developer who actually performed the change.Instead in some cases,a limited number of devel-opers are given access to submit changes to the source con-trol system on behalf of other developers.This ensures that code changes are thoroughly reviewed and approved by se-nior developers before they are integrated into the software system.Luckily in many cases,the name of the actual au-thor(s)is recorded in the explanation message attached to the change.Therefore,we analyzed these messages using several heuristics to locate the possible author.For example, our heuristics searched for tokens such as the‘@’symbol or words such“Submitted By”,“Thanks to”to locate possible acknowledgementfields and email addresses in the detailed messages.If all our heuristics fail to locate a possible de-veloper then we simply attach to a change the name of the developer as recorded by the source control repository.We also employ heuristics,similar to[9],to deal with developers changing their email addresses over time.These heuristics permit us to map a seemingly new developer showing up in the change information to another developer that may have existed previously.In addition to attaching the explanation message entered by the developer to describe a change,we performed lexical analysis,similar to[15],to automatically classify change-lists into three types based on the content of the explanation message:Fault Repairing changelists(FR):These5changes are done tofix bugs.In our analysis,we la-belled changelists which contain terms such as bug,fix, or repair in the detailed message as FR modifications. General Maintenance changelists(GM):These changes are mainly for bookkeeping and do not reflect the imple-mentation of a particular feature or the repair of a bug.For example,changes to update the copyright notice at the top of each sourcefile are ignored.Changes that are re-indentation of the source code after being pro-cessed by a code beautifier pretty-printer are ignored as well.We labelled changelists which contain terms such as indent,copyright in the explanation message as GM changelists.Feature Introduction changelists(FI):These changes add or enhance ing our lexical analysis,we la-belled all changelists that are not FR or GM changelists as FI changelists.PerformanceConceptually(as shown in Figure1),we would have to parse the source code of each snapshot.Thus for each change to the software system,we would need to re-parse the source code.This is not a reasonable approach as we would have to prase the source code for the software system a large num-ber of times.Although we use ctags to perform a large amount of our analysis,the analysis still requires some time and in a long lived software project we may have hundreds of thousands of changes that are stored in the software control repository.To enable the extraction to be done in reasonable time,we developed an incremental technique which analyzes only the changedfiles.We then integrate the analysis results to produce evolutionary change data for the whole software system.By adopting a mature source code tagger(ctags),avoid-ing the use of complex source code extractors,and focusing our extraction on changedfiles,we are able to drastically im-prove our performance.For a large system,such as NetBSD with around ten years of development,C-REX takes over twelve hours to perform its recovery.This is due to the long history of the project,the large size of its code base.For smaller systems such as Postgres,C-REX can perform its analysis in just over two hours.We believe this performance is acceptable given the amount of analysis required.Sec-tion5presents the implementation of C-REX and discuss several optimizations that we developed to process large soft-ware systems in such a timely fashion.NetBSD FreeBSD OpenBSD Postgres CVS Repository533MB367MB220MB314MB C-REX Ouput96MB67MB45MB11MB Table1:Size of Source Control Repository vs.Size of C-REX XMLfileThe evolutionary change data produced by C-REX is rep-resented as an XMLfile.Table1summarizes a few of the analyzed systems.It shows that the XML outputfile is small in comparison to the size of the analyzed CVS repository.This small size allows the outputfile to be loaded in memory for fast processing by other tools.4SCHEMA FOR THE C-REX EVOLUTIONARY CHANGE DATAIn the preceding two sections,we have outlined the need for an evolutionary extractor,proposed the development of C-REX,specified the type of information C-REX should record about source code changes,and presented additional infor-mation which C-REX attaches to the recovered change data.As we have stated,we store the output of C-REX in XML format.Others may choose to store such output in a database and provide developer APIs to access the output.We de-cided that the overheard of using SQL in the extraction and analysis steps is too high.We found that a large amount of our analysis involves loading all the data into memory and processing it.Such operation is equivalent to a full table scan,which is inefficient in modern database systems.Fur-thermore storing the output in a database would require the users of C-REX to perform additional setup work to install a database and configure it.The XMLfile can be easily pro-cessed by any tool without relying on specialized APIs.The rest of this section presents the structure of the recovered change data stored in the XMLfile.Figure4:Schema for the Change Data Extracted By C-REX Figures4and5give the schema for the C-REX output.The schema is divide over twofigures to make it easier to read.Figure4illustrates that each Change to the source code hasa Change Type.The Change Type indicates if a ChangeUnitwas modified,added,or removed.A ChangeUnit,as illus-trated in Figure5could be a source code Entity,such as a Function,a Data Type,a Global Var,or a Macro.A Change-Unit could also be a Dependency between source code Enti-ties,a Comment,or a Control Structure.C-REX records the addition or removal of an if/else clause,a case clause,a while 6。

相关文档
最新文档