计算机科学与技术设计论文外文翻译

合集下载

毕设三项文档之-外文翻译

毕设三项文档之-外文翻译

本科生毕业设计 (论文)
外文翻译
原文标题
Worlds Collide:
Exploring the Use of Social Media Technologies for
Online Learning
译文标题
世界的碰撞:
探索社交媒体技术在在线学习的应用
作者所在系别计算机科学与工程系作者所在专业计算机科学与技术作者所在班级
作者姓名
作者学号
指导教师姓名
指导教师职称讲师
完成时间2013年2月
北华航天工业学院教务处制
注:1. 指导教师对译文进行评阅时应注意以下几个方面:①翻译的外文文献与毕业设计(论文)的主题是否高度相关,并作为外文参考文献列入毕业设计(论文)的参考文献;②翻译的外文文献字数是否达到规定数量(3 000字以上);③译文语言是否准确、通顺、具有参考价值。

2. 外文原文应以附件的方式置于译文之后。

专业计算机英文作文带翻译

专业计算机英文作文带翻译

专业计算机英文作文带翻译英文,As a professional in the field of computer science, I have always been passionate about technology and its applications in various industries. My journey in this field started during my undergraduate studies, where I was exposed to the fundamentals of programming, algorithms, and data structures. The more I delved into the subject, the more I realized the immense potential and impact of computer science on our daily lives.One of the most exciting aspects of my profession is the constant innovation and evolution of technology. For example, the development of artificial intelligence and machine learning has revolutionized the way we approach problem-solving and decision-making. These technologies have been applied in diverse fields, from healthcare to finance, and have significantly improved efficiency and accuracy.In addition to the technical skills, my profession alsorequires strong problem-solving abilities and critical thinking. I often find myself tackling complex issues and devising creative solutions to overcome them. This aspect of my work keeps me engaged and motivated, as I enjoy the challenge of unraveling intricate problems.Moreover, communication and collaboration are essential in my profession. I frequently work in multidisciplinary teams, where I have to effectively communicate technical concepts to non-technical stakeholders. This requires me to be articulate and adaptable in my communication style, ensuring that everyone is on the same page.Overall, being a professional in computer science is not just about writing code or developing software. It encompasses a wide range of skills and qualities, from technical expertise to problem-solving and communication. I am proud to be a part of this dynamic and fast-paced industry, and I look forward to contributing to its continuous growth and innovation.中文,作为计算机科学领域的专业人士,我一直对技术及其在各个行业中的应用充满热情。

计算机科学与技术专业外文翻译--数据库

计算机科学与技术专业外文翻译--数据库

外文原文:Database1.1Database conceptThe database concept has evolved since the 1960s to ease increasing difficulties in designing, building, and maintaining complex information systems (typically with many concurrent end-users, and with a large amount of diverse data). It has evolved together with database management systems which enable the effective handling of databases. Though the terms database and DBMS define different entities, they are inseparable: a database's properties are determined by its supporting DBMS and vice-versa. The Oxford English dictionary cites[citation needed] a 1962 technical report as the first to use the term "data-base." With the progress in technology in the areas of processors, computer memory, computer storage and computer networks, the sizes, capabilities, and performance of databases and their respective DBMSs have grown in orders of magnitudes. For decades it has been unlikely that a complex information system can be built effectively without a proper database supported by a DBMS. The utilization of databases is now spread to such a wide degree that virtually every technology and product relies on databases and DBMSs for its development and commercialization, or even may have such embedded in it. Also, organizations and companies, from small to large, heavily depend on databases for their operations.No widely accepted exact definition exists for DBMS. However, a system needs to provide considerable functionality to qualify as a DBMS. Accordingly its supported data collection needs to meet respective usability requirements (broadly defined by the requirements below) to qualify as a database. Thus, a database and its supporting DBMS are defined here by a set of general requirements listed below. Virtually all existing mature DBMS products meet these requirements to a great extent, while less mature either meet them or converge to meet them.1.2Evolution of database and DBMS technologyThe introduction of the term database coincided with the availability of direct-access storage (disks and drums) from the mid-1960s onwards. The term represented a contrast with the tape-based systems of the past, allowing shared interactive use rather than daily batch processing.In the earliest database systems, efficiency was perhaps the primary concern, but it was already recognized that there were other important objectives. One of the key aims was to make the data independent of the logic of application programs, so that the same data could be made available to different applications.The first generation of database systems were navigational,[2] applications typically accessed data by following pointers from one record to another. The two main data models at this time were the hierarchical model, epitomized by IBM's IMS system, and the Codasyl model (Network model), implemented in a number ofproducts such as IDMS.The Relational model, first proposed in 1970 by Edgar F. Codd, departed from this tradition by insisting that applications should search for data by content, rather than by following links. This was considered necessary to allow the content of the database to evolve without constant rewriting of applications. Relational systems placed heavy demands on processing resources, and it was not until the mid 1980s that computing hardware became powerful enough to allow them to be widely deployed. By the early 1990s, however, relational systems were dominant for all large-scale data processing applications, and they remain dominant today (2012) except in niche areas. The dominant database language is the standard SQL for the Relational model, which has influenced database languages also for other data models.Because the relational model emphasizes search rather than navigation, it does not make relationships between different entities explicit in the form of pointers, but represents them rather using primary keys and foreign keys. While this is a good basis for a query language, it is less well suited as a modeling language. For this reason a different model, the Entity-relationship model which emerged shortly later (1976), gained popularity for database design.In the period since the 1970s database technology has kept pace with the increasing resources becoming available from the computing platform: notably the rapid increase in the capacity and speed (and reduction in price) of disk storage, and the increasing capacity of main memory. This has enabled ever larger databases and higher throughputs to be achieved.The rigidity of the relational model, in which all data is held in tables with a fixed structure of rows and columns, has increasingly been seen as a limitation when handling information that is richer or more varied in structure than the traditional 'ledger-book' data of corporate information systems: for example, document databases, engineering databases, multimedia databases, or databases used in the molecular sciences. Various attempts have been made to address this problem, many of them gathering under banners such as post-relational or NoSQL. Two developments of note are the Object database and the XML database. The vendors of relational databases have fought off competition from these newer models by extending the capabilities of their own products to support a wider variety of data types.1.3General-purpose DBMSA DBMS has evolved into a complex software system and its development typically requires thousands of person-years of development effort.[citation needed] Some general-purpose DBMSs, like Oracle, Microsoft SQL Server, and IBM DB2, have been undergoing upgrades for thirty years or more. General-purpose DBMSs aim to satisfy as many applications as possible, which typically makes them even more complex than special-purpose databases. However, the fact that they can be used "off the shelf", as well as their amortized cost over many applications and instances, makes them an attractive alternative (Vsone-time development) whenever they meet an application's requirements.Though attractive in many cases, a general-purpose DBMS is not always the optimal solution: When certain applications are pervasive with many operating instances, each with many users, a general-purpose DBMS may introduce unnecessary overhead and too large "footprint" (too large amount of unnecessary, unutilized software code). Such applications usually justify dedicated development.Typical examples are email systems, though they need to possess certain DBMS properties: email systems are built in a way that optimizes email messages handling and managing, and do not need significant portions of a general-purpose DBMS functionality.1.4Database machines and appliancesIn the 1970s and 1980s attempts were made to build database systems with integrated hardware and software. The underlying philosophy was that such integration would provide higher performance at lower cost. Examples were IBM System/38, the early offering of Teradata, and the Britton Lee, Inc. database machine. Another approach to hardware support for database management was ICL's CAFS accelerator, a hardware disk controller with programmable search capabilities. In the long term these efforts were generally unsuccessful because specialized database machines could not keep pace with the rapid development and progress of general-purpose computers. Thus most database systems nowadays are software systems running on general-purpose hardware, using general-purpose computer data storage. However this idea is still pursued for certain applications by some companies like Netezza and Oracle (Exadata).1.5Database researchDatabase research has been an active and diverse area, with many specializations, carried out since the early days of dealing with the database concept in the 1960s. It has strong ties with database technology and DBMS products. Database research has taken place at research and development groups of companies (e.g., notably at IBM Research, who contributed technologies and ideas virtually to any DBMS existing today), research institutes, and Academia. Research has been done both through Theory and Prototypes. The interaction between research and database related product development has been very productive to the database area, and many related key concepts and technologies emerged from it. Notable are the Relational and the Entity-relationship models, the Atomic transaction concept and related Concurrency control techniques, Query languages and Query optimization methods, RAID, and more. Research has provided deep insight to virtually all aspects of databases, though not always has been pragmatic, effective (and cannot and should not always be: research is exploratory in nature, and not always leads to accepted or useful ideas). Ultimately market forces and real needs determine the selection of problem solutions and related technologies, also among those proposed by research. However, occasionally, not the best and most elegant solution wins (e.g., SQL). Along their history DBMSs and respective databases, to a great extent, have been the outcome of such research, while real product requirements and challenges triggered database research directions and sub-areas.The database research area has several notable dedicated academic journals (e.g., ACM Transactions on Database Systems-TODS, Data and Knowledge Engineering-DKE, and more) and annual conferences (e.g., ACM SIGMOD, ACM PODS, VLDB, IEEE ICDE, and more), as well as an active and quite heterogeneous (subject-wise) research community all over the world.1.6Database architectureDatabase architecture (to be distinguished from DBMS architecture; see below) may be viewed, to some extent, as an extension of Data modeling. It is used to conveniently answer requirements of different end-users from a same database, as well as for other benefits. For example, a financial department of a company needs the payment details of all employees as part of the company's expenses, but not other many details about employees, that are the interest of the human resources department. Thus different departments need different views of the company's database, that both include the employees' payments, possibly in a different level of detail (and presented in different visual forms). To meet such requirement effectively database architecture consists of three levels: external, conceptual and internal. Clearly separating the three levels was a major feature of the relational database model implementations that dominate 21st century databases.[13]The external level defines how each end-user type understands the organization of its respective relevant data in the database, i.e., the different needed end-user views.A single database can have any number of views at the external level.The conceptual level unifies the various external views into a coherent whole, global view.[13] It provides the common-denominator of all the external views. It comprises all the end-user needed generic data, i.e., all the data from which any view may be derived/computed. It is provided in the simplest possible way of such generic data, and comprises the back-bone of the database. It is out of the scope of the various database end-users, and serves database application developers and defined by database administrators that build the database.The Internal level (or Physical level) is as a matter of fact part of the database implementation inside a DBMS (see Implementation section below). It is concerned with cost, performance, scalability and other operational matters. It deals with storage layout of the conceptual level, provides supporting storage-structures like indexes, to enhance performance, and occasionally stores data of individual views (materialized views), computed from generic data, if performance justification exists for such redundancy. It balances all the external views' performance requirements, possibly conflicting, in attempt to optimize the overall database usage by all its end-uses according to the database goals and priorities.All the three levels are maintained and updated according to changing needs by database administrators who often also participate in the database design.The above three-level database architecture also relates to and being motivated by the concept of data independence which has been described for long time as a desired database property and was one of the major initial driving forces of the Relational model. In the context of the above architecture it means that changes made at a certain level do not affect definitions and software developed with higher level interfaces, and are being incorporated at the higher level automatically. For example, changes in the internal level do not affect application programs written using conceptual level interfaces, which saves substantial change work that would be needed otherwise.In summary, the conceptual is a level of indirection between internal and external. On one hand it provides a common view of the database, independent of different external view structures, and on the other hand it is uncomplicated by details of how the data is stored or managed (internal level). In principle every level, and even every external view, can be presented by a different data model. In practice usually a given DBMS uses the same data model for both the external and the conceptual levels (e.g., relational model). The internal level, which is hidden inside the DBMS and depends on its implementation (see Implementation section below), requires a different levelof detail and uses its own data structure types, typically different in nature from the structures of the external and conceptual levels which are exposed to DBMS users (e.g., the data models above): While the external and conceptual levels are focused on and serve DBMS users, the concern of the internal level is effective implementation details.中文译文:数据库1.1 数据库的概念数据库的概念已经演变自1960年以来,以缓解日益困难,在设计,建设,维护复杂的信息系统(通常与许多并发的最终用户,并用大量不同的数据)。

计算机科学与技术 外文翻译 英文文献 中英对照

计算机科学与技术 外文翻译 英文文献 中英对照

附件1:外文资料翻译译文大容量存储器由于计算机主存储器的易失性和容量的限制, 大多数的计算机都有附加的称为大容量存储系统的存储设备, 包括有磁盘、CD 和磁带。

相对于主存储器,大的容量储存系统的优点是易失性小,容量大,低成本, 并且在许多情况下, 为了归档的需要可以把储存介质从计算机上移开。

术语联机和脱机通常分别用于描述连接于和没有连接于计算机的设备。

联机意味着,设备或信息已经与计算机连接,计算机不需要人的干预,脱机意味着设备或信息与机器相连前需要人的干预,或许需要将这个设备接通电源,或许包含有该信息的介质需要插到某机械装置里。

大量储存器系统的主要缺点是他们典型地需要机械的运动因此需要较多的时间,因为主存储器的所有工作都由电子器件实现。

1. 磁盘今天,我们使用得最多的一种大量存储器是磁盘,在那里有薄的可以旋转的盘片,盘片上有磁介质以储存数据。

盘片的上面和(或)下面安装有读/写磁头,当盘片旋转时,每个磁头都遍历一圈,它被叫作磁道,围绕着磁盘的上下两个表面。

通过重新定位的读/写磁头,不同的同心圆磁道可以被访问。

通常,一个磁盘存储系统由若干个安装在同一根轴上的盘片组成,盘片之间有足够的距离,使得磁头可以在盘片之间滑动。

在一个磁盘中,所有的磁头是一起移动的。

因此,当磁头移动到新的位置时,新的一组磁道可以存取了。

每一组磁道称为一个柱面。

因为一个磁道能包含的信息可能比我们一次操作所需要得多,所以每个磁道划分成若干个弧区,称为扇区,记录在每个扇区上的信息是连续的二进制位串。

传统的磁盘上每个磁道分为同样数目的扇区,而每个扇区也包含同样数目的二进制位。

(所以,盘片中心的储存的二进制位的密度要比靠近盘片边缘的大)。

因此,一个磁盘存储器系统有许多个别的磁区, 每个扇区都可以作为独立的二进制位串存取,盘片表面上的磁道数目和每个磁道上的扇区数目对于不同的磁盘系统可能都不相同。

磁区大小一般是不超过几个KB; 512 个字节或1024 个字节。

毕业设计外文翻译--嵌入式_Linux_应用:概述

毕业设计外文翻译--嵌入式_Linux_应用:概述

毕业设计外文资料翻译(译文)题目名称:Embedded Linux applications: An overview学院:计算机科学技术专业年级:计算机科学与技术07级学生姓名:xx班级学号: 1班 16号指导教师:xx二○一一年四月十日译文题目:Embedded Linux applications: An overview原文题目:嵌入式 Linux 应用:概述原文出处:Internet source : /developer- -works/cn/linux/embed/embl/overview/index.htmlEmbedded Linux applications: An overviewLinux now spans the spectrum of computing applications, including IBM's tiny Linux wrist watch, hand-held devices (PDAs and cell phones), Internet appliances, thin clients, firewalls, industrial robotics, telephony infrastructure equipment, and even cluster-based supercomputers. Let's take a look at what Linux has to offer as an embedded system, and why it's the most attractive option currently available.One. Emergence of embedded systemsThe computers used to control equipment, otherwise known as embedded systems, have been around for about as long as computers themselves. They were first used back in the late 1960s in communications to control electromechanical telephone switches. As the computer industry has moved toward ever smaller systems over the past decade or so, embedded systems have moved along with it, providing more capabilities for these tiny machines. Increasingly, these embedded systems need to be connected to some sort of network, and thus require a networking stack, which increases the complexity level and requires more memory and interfaces, as well as, you guessed it, the services of an operating system.Off-the-shelf operating systems for embedded systems began to appear in the late 1970s, and today several dozen viable options are available. Out of these, a few major players have emerged, such as VxWorks, pSOS, Neculeus, and Windows CE.Two. Advantages/disadvantages of using Linux for your embedded systemAlthough most Linux systems run on PC platforms, Linux can also be a reliable workhorse for embedded systems. The popular "back-to-basics" approach of Linux, which makes it easier and more flexible to install and administer than UNIX, is an added advantage for UNIX gurus who already appreciate the operating system because it has many of the same commands and programming interfaces as traditional UNIX.The typical shrink-wrapped Linux system has been packaged to run on a PC, with a hard disk and tons of memory, much of which is not needed on an embedded system. A fully featured Linux kernel requires about 1 MB of memory. However, the Linux micro-kernel actually consumes very little of this memory, only 100 K on a Pentium CPU, including virtual memory and all core operating system functions. With the networkingstack and basic utilities, a complete Linux system runs quite nicely in 500 K of memory on an Intel 386 microprocessor, with an 8-bit bus (SX). Because the memory required is often dictated by the applications needed, such as a Web server or SNMP agent, a Linux system can actually be adapted to work with as little as 256 KB ROM and 512 KB RAM. So it's a lightweight operating system to bring to the embedded market.Another benefit of using an open source operating system like Embedded Linux over a traditional real-time operating system (RTOS), is that the Linux development community tends to support new IP and other protocols faster than RTOS vendors do. For example, more device drivers, such as network interface card (NIC) drivers and parallel and serial port drivers, are available for Linux than for commercial operating systems.The core Linux operating system itself has a fairly simple micro-kernel architecture. Networking and file systems are layered on top of the micro-kernel in modular fashion. Drivers and other features can be either compiled in or added to the kernel at run-time as loadable modules. This provides a highly modular building-block approach to constructing a custom embeddable system, which typically uses a combination of custom drivers and application programs to provide the added functionality.An embedded system also often requires generic capabilities, which, in order to avoid re-inventing the wheel, are built with off-the-shelf programs and drivers, many of which are available for common peripherals and applications. Linux can run on most microprocessors with a wide range of peripherals and has a ready inventory of off-the-shelf applications.Linux is also well-suited for embedded Internet devices, because of its support of multiprocessor systems, which lends it scalability. This capability gives a designer the option of running a real-time application on a dual processor system, increasing total processing power. So you can run a Linux system on one processor while running a GUI, for example, simultaneously on another processor.The one disadvantage to running Linux on an embedded system is that the Linux architecture provides real-time performance through the addition of real-time software modules that run in the kernel space, the portion of the operating system that implements the scheduling policy, hardware-interrupts exceptions and program execution. Since these real-time software modules run in the kernel space, a code error can impact the entire system's reliability by crashing the operating system, which can be a very serious vulnerability for real-time applications.An off-the-shelf RTOS, on the other hand, is designed from the ground up for real-time performance, and provides reliability through allocating certain processes a higher priority than others when launched by a user as opposed to by system-level processes. Processes are identified by the operating system as programs that execute inmemory or on the hard drive. They are assigned a process ID or a numerical identifier so that the operating system may keep track of the programs currently executing and of their associated priority levels. Such an approach ensures a higher reliability (predictability) with the RTOS time than Linux is capable of providing. But all-in-all, it's still a more economical choice.Three. Different types of Embedded Linux systemsThere are already many examples of Embedded Linux systems; it's safe to say that some form of Linux can run on just about any computer that executes code. The ELKS (Embeddable Linux Kernel Subset) project, for example, plans to put Linux onto a Palm Pilot. Here are a couple of the more well-known small footprint Embedded Linux versions:ETLinux -- a complete Linux distribution designed to run on small industrial computers, especially PC/104 modules.LEM -- a small (<8 MB) multi-user, networked Linux version that runs on 386s.LOAF -- "Linux On A Floppy" distribution that runs on 386s.uClinux -- Linux for systems without MMUs. Currently supports Motorola 68K, MCF5206, and MCF5207 ColdFire microprocessors.uLinux -- tiny Linux distribution that runs on 386s.ThinLinux -- a minimized Linux distribution for dedicated camera servers, X-10 controllers, MP3 players, and other such embedded applications.Software and hardware requirementsSeveral user-interface tools and programs enhance the versatility of the Linux basic kernel. It's helpful to look at Linux as a continuum in this context, ranging from a stripped-down micro-kernel with memory management, task switching and timer services to a full-blown server supporting a complete range of file system and network services.A minimal Embedded Linux system needs just three essential elements:∙ A boot utility∙The Linux micro-kernel, composed of memory management, process management and timing services∙An initialization processTo doing anything useful while remaining minimal, you also need to add:∙Drivers for hardware∙One or more application processes to provide the needed functionalityAs additional requirements become necessary, you might also want:∙ A file system (perhaps in ROM or RAM)∙TCP/IP network stack∙ A disk for storing semi-transient data and swap capability∙ A 32-bit internal CPU (required by all complete Linux systems)Four. Hardware platform optionsChoosing the best hardware can be complex because of internal company politics, prejudices, legacies of other projects, a lack of complete or accurate information, and cost, which should take into account the total product costs and not just the CPU itself. Sometimes a fast, inexpensive CPU can become expensive once bus logic and the delays necessary to make it work with other peripherals are considered. To calculate the necessary speed of a CPU for any given project, start with a realistic view of how fast the CPU needs to run to accomplish a given task and triple it. Also, determine how fast the bus needs to run. If there are secondary buses, such as a PCI bus, consider them also. A slow bus (that is, one that is saturated with DMA traffic) can significantly slow down a fast CPU. Here are some of the best hardware solutions for Embedded Linux applications.Bright Star Engineering: Bright Star Engineering's ipEngine-1 is a credit-card sized single-board computer with Embedded Linux support. It utilizes a PowerPC-based CPU and provides an array of on-board peripherals, including Ethernet, LCD/Video Controller, USB, Serial I/O, and a 16K gate user-configurable FPGA. BSE's Embedded Linux configuration allows Linux to be booted from the ipEngine's on-board 4MB flash memory.Calibri: CalibriTM-133 is a ready-to-use, compact, multipurpose network appliance that uses Embedded Linux as its operating system. It offers a highly efficient and low-cost solution to firewall, VPN, and routing demands.EmbeddedPlanet: EmbeddedPlanet has created a PostPC-era computer that comes loaded with MontaVista's HardHat Linux. Powered by a PowerPC-based computing engine and matching I/O card, Linux Planet comes in a colorful translucent case with a touchscreen and access to digital and analog I/O.Eurotech: Eurotech provides embedded PC SBC and sponsors ET-Linux, a complete Linux system designed to run on small industrial computers and based on glibc 2.1.2.Microprocess Ingenierie: Microprocess develops, produces, and sells standard and customized products for the industrial and embedded market. Microprocess has a global activity in real-time software and great expertise in systems integration. Its products, like the 740 PowerPC compactPCI board, can be ordered with a standard distribution of Linux or an Embedded Linux version.Moreton Bay: Moreton Bay is releasing their NETtel 2520 and NETtel 2500 rangeof Linux-based Internet routers. These small, easy-to-connect intelligent router solutions are engineered to offer a simple, secure, and affordable extranet-friendly Virtual Private Network (VPN) for flat networks. The NETtel router family runs an Embedded Linux kernel. A development kit is available; it enables customized code to be stored in flash memory and executed inside the NETtel. The code may contain special encryption or authentication protocols, or some local monitoring script where NETtel is used as a remote control device.Matrix Orbital: This an optional, but not recommended, addition. Matrix Orbital manufactures a line of serial LCDs and VFDs, which many Linux users are including in their embedded systems. The product line ranges from 8x2 to 40x4 character LCDs, 20x2 and 20x4 VFDs, plus a 240x64 graphic LC (128x128 on the way). Communication with the displays is accomplished via either RS232 or I2C, both of which are standard on all of their modules. A comprehensive command set is included in the modules' BIOS.Five. Real-time Embedded Linux applicationsOne of the most important issues with embedded systems is the need for a real-time operating system. The definition of real-time here varies quite a bit. To some people, real-time means responding to an event in the one-microsecond range, to others it is 50 milliseconds. The hardness of real-time also varies quite a bit. Some systems need hard real-time response, with short deterministic response latencies to events. However, on many systems, when analyzed closely, we see a response time requirement that is actually near real-time. Often the real-time requirement is a tradeoff of time and buffer space. With memory getting cheaper, and CPUs getting faster, near real-time is now more typical than hard real-time and many commercial operating systems that claim to be real-time are far from being hard real-time. Usually, when you get into the detailed design of these systems, there are warnings that the drivers' interrupts and applications must be very carefully designed in order to meet real-time requirements.RT-Linux (Linux with real-time extensions) contains time critical functions to provide precise control over interrupt handling, through the use of an interrupt manager, and does a good job of making sure that critical interrupts get executed when needed. The hardness of this approach depends mostly on the CPU interrupt structure and context-switch hardware support. This approach is sufficient for a large range of real-time requirements. Even without the real-time extensions, Linux does pretty well at keeping up with multiple streams of events. For example, a Linux PC system on a low end Pentium is able to keep multiple 10BaseT interfaces executing effectively, while simultaneously running character-level serial ports at a full 56KBPS without losing any data.Some real-time hardware and software Linux APIs to consider are RTLinux, RTAI, EL, and Linux-SRT. RTLinux is a hard real-time Linux API originally developed at the New Mexico Institute of Technology. RTAI (DIAPM) is a spin-off of the RTLinux real-time API that was developed by programmers at the Department of Aerospace Engineering, Polytechnic Politecnico di Milano (DIAPM). EL/IX is a proposed POSIX-based hard real-time Linux API being promoted by Red Hat. And Linux-SRT is a soft real-time alternative to real-time APIs, which provides performance-enhancing capabilities to any Linux program without requiring that the program be modified or recompiled.See the Resources section later in this article for information on the above and for some Web sites offering different flavors of software extensions, development tools, support, and training courses for the standard Linux operating system.Short deterministic response latenciesSome real-time embedded systems need to respond quickly to external events in order to accomplish a specific task. A custom microcontroller embedded inside a missile, for example, needs to respond quickly to external events such as moving targets, weather, humans, etc., before instructing the missile to target a specific object in its surrounding environment. Short deterministic response latencies mean that the embedded system can determine the time it will take to respond to an external event.Six. Configuration proceduresNow let's take a look at how to make LEM, a small, embeddable Linux distribution, which provides both network and X server. You can download this distribution, although it is not essential. You will need a full Linux distribution to build your own Embedded Linux operating system, which will contain everything you need (utilities, sources, compiler, debugger, and documentation). Here is a list of the software that can be used to make LEM:TinyLogin: TinyLogin is a suite of tiny UNIX utilities for handling logging into, being authenticated by, changing one's password for, and otherwise maintaining users and groups on an embedded system. It also provides shadow password support to enhance system security. TinyLogin is, as the name implies, very small, and makes an excellent complement to BusyBox on an embedded System.BusyBox: BusyBox is a multicall binary used to provide a minimal subset of POSIX-style commands and specialized functions. It is geared toward the very small, such as boot floppies, embedded systems, etc. Specifically it is used in the Debian Rescue/Install system (which inspired development on the original BusyBox ), the Linux Routeur Project, LEM, lineo, and others. Busybox is being maintained by Erik Andersen.Ash: Ash is a very small Bourne shell.Sysvinit: Sysvinit is the most used init package for Linux. We will use init and the C version of the start-stop-daemon.See the Resources section for more information on these items.Seven. Creating a bootdiskA bootdisk is basically a miniature, self-contained Linux system on a floppy diskette. It can perform many of the same functions that a complete full-size Linux system performs. The following material is based on the Bootdisk-HOWTO (see Resources).Step 1. BiosAll PC systems start the boot process by executing code in ROM (specifically, the BIOS) to load the sector from sector 0, cylinder 0 of the boot drive. The boot drive is usually the first floppy drive (designated A: in DOS and /dev/fd0 in Linux). The BIOS then tries to execute this sector. On most bootable disks, sector 0, cylinder 0 contains either: ∙Code from a boot loader such as LILO, which locates the kernel, loads it, and executes it to start the boot proper∙The start of an operating system kernel, such as LinuxIf a Linux kernel has been raw copied to a diskette, a hard drive, or another media, the first sector of the disk will be the first sector of the Linux kernel itself. This first sector will continue the boot process by loading the rest of the kernel from the boot device.Step 2. The boot loaderYou will use a boot loader like LILO to operate the boot process. It allows the development and production platforms to co-exist on the same hardware and permits switching from one to the other just by rebooting. The LILO boot loader is loaded by the bios. It then loads kernels or the boot sectors of other operating systems. It also provides a simple command line interface to interactively select the item to boot with its options. See Resources for more information on LILO.Step 3. The kernelThe kernel checks the hardware and mounts the root device and then looks for the init program on the root filesystem and executes it.Step 4. InitInit is the parent of all other processes that will run on your Linux OS. It will watch its child processes and start, stop, re-launch them if needed. Init takes all information from /etc/inittab.Step 5. InittabThe file /etc/inittab/ refers to scripts named /etc/rc... to do the system setup. It also hasentries for the getty tool to handle the login process.Step 6. The login processThere is one getty available in the inittab file for each console allowed for the users. Getty will launch /bin/login to verify the user password.Step 7. Creating a new partitionFrom the LFS-HOWTO (see Resources): Before we can build our new Linux system, we need to have an empty Linux partition on which we can build our new system. If you already have a Linux Native partition available, you can skip this step and the following one. Start the fdisk program (or cfdisk if you prefer that program) with the appropriate hard disk as the option (like /dev/hda if you want to create a new partition on the primary master IDE disk). Create a Linux Native partition, write the partition table, and exit the (c)fdisk program. If you get the message that you need to reboot your system to ensure that the partition table is updated, then please reboot your system now before continuing.Step 8. Creating an ext2 file system on the new partitionFrom the LFS-HOWTO (see Resources): To create a new ext2 file system we use the mke2fs command. Give $LFS as the only option, and the file system will be created. From now on I'll refer to this newly created partition as $EMBPART. $EMBPART should be substituted with the partition you have created.Step 9. Mounting the partitionTo access the newly created filesystem, you have to mount it. To do this, create an /mnt/hda? directory and type the following at the shell prompt:mkdir /mnt/hda?mount $EMBPART /mnt/hda?If you created your partition on /dev/hda4 and you mounted it on /mnt/hda4, then you'll need to return to the step where you copied a file to $dollar;EMBPART/usr/sbin, and copy that file to /mnt/hda4/usr/bin. Do this after the last command in Step 14 (Copy the file in $EMBPART/usr/sbin).Step 10. Populating the filesystemThe root filesystem must contain everything needed to support a full Linux system. We will build a directory structure not that far from the File Hierarchy Standard (see Resources).Step 11. DirectoriesThe mkdir function in the new mounted filesystem creates the following directories: /procDirectory stub required by the proc filesystem/etcSystem configuration file/sbinCritical System binaries/binBasic binaries considered part of the system/libShared Libraries to provide run-time support/mntMount point for maintenance/usrAdditional utilities and applications∙cd /mnt/hda?∙mkdir bin dev home proc sbin usr boot etc liv mnt root tmp var∙mkdir -p usr/bin usr/sbin usr/share usr/lib∙mkdir -p etc/config etc/default etc/init.d etc/rc.boot∙mkdir -p etc/rc0.d etc/rc1.d etc/rc2.d etc/rc3.d etc/rc4.d etc/rc5.d etc/rc6.d etc/rcS.d/devThe dev directory is the stub required to perform devices input / output. Each file in this directory may be created using the mknod function. You may save time by directly copying the required dev entries from your desktop Linux, using the following instruction: cp -dpR /dev /mntEight. Installing TinyLogin and login dependenciesTinyLogin (see the Resources section to install it) will give us the following tools in less than 35Kb:/bin/addgroup, /bin/adduser, /bin/delgroup, /bin/deluser, /bin/login, /bin/su, /sbin/getty, /sbin/sulogin, /usr/bin/passwd.Please refer to your main distribution doc or man pages for a full description of those commands.Step 12. Configuring TinyLoginFrom the TinyLogin README: TinyLogin is modularized to help you build only the components you need, thereby reducing binary size. To turn off unwanted TinyLogin components, simply edit the file tinylogin.def.h and comment out the parts you do not want using C++ style (//) comments.Step 13. Installing TinyLoginAfter the build is complete, a tinylogin.links file is generated, which is then used by make install to create symlinks to the tinylogin binary for all compiled-in functions. By default, make install will place a symlink forest into pwd /_install unless you have defined thePREFIX environment variable.Step 14. Installing Sysvinit and start-stop daemonAfter the kernel is done loading, it tries to run the init program to finalize the boot process. Now:1.Unpack the Sysvinit archive2.Go to the src directory3.Copy the init executable in $EMBPART/sbinThe Sysvinit package also offers a C version of the start-stop-daemon in the contrib directory.pile it2.Copy the file in $EMBPART/usr/sbinStep 15. Configuring SysvinitSysvinit needs a configuration file named inittab, which should be placed in $EMBPART/etc. Here is the one used in the LEM distribution:# /etc/inittab: init(8) configuration.# $Id: inittab,v 1.6 1997/01/30 15:03:55 miquels Exp $# Modified for LEM 2/99 by Sebastien HUET# default rl.id:2:initdefault:# first except in emergency (-b) mode.si::sysinit:/etc/init.d/rcS# single-user mode.~~:S:wait:/sbin/sulogin# /etc/init.d executes the S and K scripts upon change# 0:halt 1:single-user 2-5:multi-user (5 may be X with xdm or other) 6:reboot.l0:0:wait:/etc/init.d/rc 0l1:1:wait:/etc/init.d/rc 1l2:2:wait:/etc/init.d/rc 2l3:3:wait:/etc/init.d/rc 3l4:4:wait:/etc/init.d/rc 4l5:5:wait:/etc/init.d/rc 5l6:6:wait:/etc/init.d/rc 6# CTRL-ALT-DEL pressed.ca:12345:ctrlaltdel:/sbin/shutdown -t1 -r now# Action on special keypress (ALT-UpArrow).kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."# /sbin/mingetty invocations for runlevels.1:2345:respawn:/sbin/getty 9600 tty12:23:respawn:/sbin/getty 9600 tty2#3:23:respawn:/sbin/getty tty3 #you may add console there#4:23:respawn:/sbin/getty tty4Step 16. Creating initial boot scriptsAs seen in the inittab file, Sysvinit needs additional scripts in its own directories.Step 17. Creating the necessary directories and base filesUse the following command to create the directories:cd $EMBPART/etcmkdir rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d init.d rcS.d rc.bootGo to the unpacked Sysvinit source directoryCopy the debian/etc/init.d/rc to:$EMBART/etc/init.dGo to the $EMBPART/etc/init.d/Create a new file rcS like those in LEM:#!/bin/shPATH=/sbin:/bin:/usr/sbin:/usr/binrunlevel=Sprevlevel=Numask 022export PATH runlevel prevlevel/etc/default/rcSexport VERBOSE# Trap CTRL-C only in this shell so we can interrupt subprocesses.trap ":" 2 3 20# Call all parts in order.for i in /etc/rcS.d/S??*do[ ! -f "$i" ] && continuecase "$i" in*.sh)(trap - 2 3 20. $i start);;*)$i start;;esacdone# run the files in /etc/rc.boot[ -d /etc/rc.boot ] && run-parts /etc/rc.bootCopy run-parts from your distro to $EMBPART/bin.Step 18. Adding base scriptsA lot of the commands being used here are UNIX/Linux commands that set, export, etc. paths that are embedded inside of a UNIX shell script.<!-reboot---------------------------------------------->Create a new file reboot containing the following:#!/bin/shPATH=/sbin:/bin:/usr/sbin:/usr/binecho -n "Rebooting... "reboot -d -f -i<!-halt---------------------------------------------->Create a new file halt containing the following:#!/bin/shPATH=/sbin:/bin:/usr/sbin:/usr/binhalt -d -f -i -p<!-mountfs---------------------------------------------->Nine. SummaryThe Linux operating system has a very bright future in the area of embedded applications for anything from Internet appliances to dedicated control systems. Roughly 95% of all newly manufactured microcomputer chips are used for embedded applications. The power, reliability, flexibility, and scalability of Linux, combined with its support for a multitude of microprocessor architectures, hardware devices, graphics support, and communications protocols have established Linux as an increasingly popular software platform for a vast array of projects and products.Because Linux is openly and freely available in source form, many variations and configurations of Linux and its supporting software components have evolved to meet the diverse needs of the markets and applications to which Linux is being adapted. There are small footprint versions and real-time enhanced versions. Despite the origins of Linux asa PC architecture operating system, there are now ports to numerous non-x86 CPUs, with and without memory management units, including PowerPC, ARM, MIPS, 68K, and even microcontrollers. But look out, there's more coming in the near future for many other Information Technology (IT) domains!嵌入式Linux 应用:概述现在Linux 广泛用于各类计算应用,不仅包括IBM 的微型Linux 腕表、手持设备(PDA 和蜂窝电话)、因特网装置、瘦客户机、防火墙、工业机器人和电话基础设施设备,甚至还包括了基于集群的超级计算机。

计算机科学与技术毕业设计(论文)外文翻译

计算机科学与技术毕业设计(论文)外文翻译

本科毕业设计(论文) 外文翻译(附外文原文)系 ( 院 ):信息科学与工程学院课题名称:学生信息管理系统专业(方向):计算机科学与技术(应用)7.1 Enter ActionMappingsThe Model 2 architecture (see chapter 1) encourages us to use servlets and Java- Server Pages in the same application. Under Model 2, we start by calling a servlet.The servlet handles the business logic and directs control to the appropriate pageto complete the response.The web application deployment descriptor (web.xml) lets us map a URL patternto a servlet. This can be a general pattern, like *.do, or a specific path, like saveRecord.do.Some applications implement Model 2 by mapping a servlet to each business operation. This approach works, but many applications involve dozens or hundredsof business operations. Since servlets are multithreaded, instantiating so manyservlets is not the best use of server resources. Servlets are designed to handle anynumber of parallel requests. There is no performance benefit in simply creatingmore and more servlets.The servlet’s primary job is to interact with the container and HTTP. Handlinga business operation is something that a servlet could delegate to another component. Struts does this by having the ActionServlet delegate the business operationto an object. Using a servlet to receive a request and route it to a handler is knownas the Front Controller pattern [Go3].Of course, simply delegating the business operation to another componentdoes not solve the problem of mapping URIs [W3C, URI] to business operations.Our only way of communicating with a web browser is through HTTP requests and URIs. Arranging for a URI to trigger a business operation is an essential part of developing a web application.Meanwhile, in practice many business operations are handled in similar ways.Since Java is multithreaded, we could get better use of our server resources if wecould use the same Action object to handle similar operations. But for this towork, we might need to pass the object a set of configuration parameters to usewith each operation.So what’s the bottom line? To implement Model 2 in an efficient and flexibleway, we need to:Enter ActionMappings 195♉ Route requests for our business operations to a single servlet♉ Determine which business operation is related to the request♉ Load a multithreaded helper object to handle the business operation♉ Pass the helper object the specifics of each request along with any configuration detail used by this operationThis is where ActionMappings come in.7.1.1 The ActionMapping beanAn ActionMapping (org.apache.struts.action.ActionMapping) describes howthe framework handles each discrete business operation (or action). In Struts,each ActionMapping is associated with a specific URI through its path property. When a request comes in, the ActionServlet uses the path property to select the corresponding ActionMapping. The set of ActionMapping objects is kept in an ActionMappings collection (org.apache.struts.action.ActionMappings). Originally, the ActionMapping object was used to extend the Action objectrather than the Action class. When used with an Action, a mapping gives a specific Action object additional responsibilities and new functionality. So, it was essentiallyan Action decorator [Go4]. Along the way, the ActionMapping evolved into anobject in its own right and can be used with or without an Action.DEFINITION The intent of the decorator pattern is to attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassingfor extending functionality [Go4].The ActionMappings are usually created through the Struts configuration file.For more about this file, see chapter 4.7.1.2 The ActionMappings catalogThe ActionMappings catalog the business logic available to a Struts application.When a request comes in, the servlet finds its entry in the ActionMappings catalogand pulls the corresponding bean.The ActionServlet uses the ActionMapping bean to decide what to do next. Itmay need to forward control off to another resource. Or it may need to populateand validate an ActionForm bean. At some point, it may have to pass control to an Action object, and when the Action returns, it may have to look up an Action-Forward associated with this mapping.196 CHAPTER 7Designing with ActionMappingsThe ActionMapping works like a routing slip for the servlet. Depending onhow the mapping is filled out, the request could go just about anywhere.The ActionMappings represent the core design of a Struts application. If youwant to figure out how a Struts application works, start with the ActionMappings. Ifyou want to figure out how to write a new Struts application, start with the Action- Mappings. The mappings are at the absolute center of every Struts application.In this chapter, we take a close look at the ActionMapping properties andexplore how they help you design the flow of a Struts application.1.0 vs 1.1 In Struts 1.1, ActionMapping subclasses ActionConfig (org.apache. struts.config.ActionConfig) and adds API methods required forbackward compatibility. ActionMapping is not deprecated, and how thehierarchy will be handled in future releases has not been determined.For now, we refer to the ActionMapping class, but you should note thatin Struts 1.1 all of the action properties are actually defined by the ActionConfigsuper class. The ActionMapping class otherwise works thesame way in both versions.7.2 ActionMapping propertiesTable 7.1 describes the base ActionMapping properties. As with other configuration components, developers may extend ActionMapping to provide additionalproperties.Table 7.1 The base ActionMapping propertiesProperty Descriptionpath The URI path from the request used to select this mapping. (API command) forward The context-relative path of the resource that should serve this request via a forward.Exactly one of the forward, include, or type properties must be specified.orinclude The context-relative path of the resource that should serve this request via aninclude. Exactly one of the forward, include, or type properties must be specified.ortype Optionally specifies a subclass oforg.apache.struts.action.ActionMappingthat should be used when instantiating this mapping.className The fully qualified name of the Action class used by this mapping. SinceStruts 1.1ActionMapping properties 197In the sections that follow, we take a look at each of these properties.7.2.1 The path propertyThe ActionMapping URI, or path, will look to the user like just another file onthe web server. But it does not represent a file. It is a virtual reference to our ActionMapping.Because it is exposed to other systems, the path is not really a logical name, likethose we use with ActionForward. The path can include slashes and an extension—as if it referred to a file system—but they are all just part of a single name.The ActionMappings themselves are a “flat” namespace with no type of internalhierarchy whatsoever. They just happen to use the same characters that we areused to seeing in hierarchical file systems.name The name of the form bean, if any, associated with this action. This is not the classname. It is the logical name used in the form bean configuration.roles The list of security roles that may access this mapping.scope The identifier of the scope (request or session) within which the form bean, if any,associated with this mapping will be created.validate Set to true if the validate method of the form bean (if any) associated with thismapping should be called.input Context-relative path of the input form to which control should be returned ifa validationerror is encountered. This can be any URI: HTML, JSP, VM, or another Action- Mapping.parameter General-purpose configuration parameter that can be used to pass extra informationto the Action selected by this ActionMapping.attribute Name of the request-scope or session-scope attribute under which our form bean isaccessed, if it is other than the bean's specified name.prefix Prefix used to match request parameter names to form bean property names, if any.suffix Suffix used to match request parameter names when populating the properties ofour ActionForm bean, if any.unknown Can be set to true if this mapping should be configured as the default for this application(to handle all requests not handled by another mapping). Only one mappingcan be defined as the default unknown mapping within an application.forwards(s) Block of ActionForwards for this mapping to use, if any.exception(s) Block of ExceptionHandlers for this mapping to use, if any.Table 7.1 The base ActionMapping properties (continued)Property DescriptionSinceStruts 1.1SinceStruts 1.1198 CHAPTER 7Designing with ActionMappingsOf course, it can still be useful to treat your ActionMappings as if they werepart of a hierarchy and group related commands under the same "folder." Theonly restriction is that the names must match whatever pattern is used in the application’s deployment description (web.xml) for the ActionServlet. This is usuallyeither /do/* or *.do, but any similar pattern can be used.If you are working in a team environment, different team members can begiven different ActionMapping namespaces to use. Some people may be workingwith the /customer ActionMappings, others may be working with the /vendor ActionMappings. This may also relate to the Java package hierarchy the team isusing. Since the ActionMapping URIs are logical constructs, they can be organizedin any way that suits your project.With Struts 1.1, these types of namespaces can be promoted to applicationmodules. Each team can work independently on its own module, with its own setof configuration files and presentation pages. Configuring your application to use multiple modules is covered in chapter 4.DEFINITION The web runs on URIs, and most URIs map to physical files. If you want to change the resource, you change the corresponding file. Some URIs, likeStruts actions, are virtual references. They do not have a correspondingfile but are handled by a programming component. To change the resource,we change how the component is programmed. But since thepath is a URI and interacts with other systems outside our control, thepath is not a true logical reference—the name of an ActionForward, forinstance. We can change the name of an ActionForward without consultingother systems. It’s an internal, logical reference. If we change thepath to an ActionMapping, we might need to update other systems thatrefer to the ActionMapping through its public URI.7.2.2 The forward propertyWhen the forward property is specified, the servlet will not pass the request to an Action class but will make a call to RequestDispatcher.forward. Since the operationdoes not use an Action class, it can be used to integrate Struts with otherresources and to prototype systems. The forward, include, and type propertiesare mutually exclusive. (See chapter 6 for more information.)7.2.3 The include propertyWhen the include property is specified, the servlet will not pass the request to an Action class but will make a call to RequestDispatcher.include. The operationActionMapping properties 199does not use an Action class and can be used to integrate Struts with other components. The forward, include, and type properties are mutually exclusive. (Seechapter 6 for more information.)7.2.4 The type propertyMost mappings will specify an Action class type rather than a forward or include.An Action class may be used by more than one mapping. The mappings may specifyform beans, parameters, forwards, or exceptions. The forward, include, andtype properties are mutually exclusive.7.2.5 The className propertyWhen specified, className is the fully qualified Java classname of the ActionMapping subclass that should be used for this object. This allows you to use your own ActionMapping subclass with specialized methods and properties. See alsosection 7.4.7.2.6 The name propertyThis property specifies the logical name for the form bean, as given in the formbean segment of the Struts configuration file. By default, this is also the name tobe used when placing the form bean in the request or session context. Use theattribute property of this class to specify a different attribute key.7.2.7 The roles propertyThis property is a comma-delimited list of the security role names that are allowed access to this ActionMapping object. By default, the same system that is used with standard container-based security is applied to the list of roles given here. Thismeans you can use action-based security in lieu of specifying URL patterns in the deployment descriptor, or you can use both together.The security check is handled by the processRoles method of the Request- Processor (org.apache.struts.action.RequestProcessor). By subclassing RequestProcessor, you can also use the roles property with application-based security. See chapter 9 for more about subclassing RequestProcessor.7.2.8 The scope propertyThe ActionForm bean can be stored in the current request or in the session scope (where it will be available to additional requests). While most developers userequest scope for the ActionForm, the framework default is session scope. Tomake request the default, see section 7.4.SinceStruts 1.1SinceStruts 1.1200 CHAPTER 7Designing with ActionMappings7.2.9 The validate propertyAn important step in the lifecycle of an ActionForm is to validate its data before offering it to the business layer. When the validate property for a mapping is true, the ActionServlet will call the ActionForm’s validate method. If validate returns false, the request is forwarded to the resource given by the input property.Often, developers will create a pair of mappings for each data entry form. Onemapping will have validate set to false, so you can create an empty form. Theother has validate set to true and is used to submit the completed form.NOTE Whether or not the ActionForm validate method is called does not relateto the ActionServlet’s validating property. That switch controlshow the Struts configuration file is processed.7.2.10 The input propertyWhen validate is set to true, it is important that a valid path for input be provided. This is where control will pass should the ActionForm validate methodreturn false. Often, this is the address for a presentation page. Sometimes it willbe another Action path (with validate set to false) that is required to generatedata objects needed by the page.NOTE The input path often leads back to the page that submitted the request.While it seems natural for the framework to return the request to whereit originated, this is not a simple task in a web application. A request is oftenpassed from component to component before a response is sent backto the browser. The browser only knows the path it used to retrieve theinput page, which may or may not also be the correct path to use for theinput property. While it may be possible to try and generate a default inputpage based on the HTTP referrer attribute, the Struts designersdeemed that approach unreliable.inputForwardIn Struts 1.0, the ActionMapping input property is always a literal URI. InStruts 1.1, it may optionally be the name of an ActionForward instead. The ActionForward is retrieved and its path property is used as the input property.This can be a global or local ActionForward.To use ActionForwards here instead of literal paths, set the inputForwardattribute on the <controller> element for this module to true:SinceStruts 1.1ActionMapping properties 201<controller inputForward="true">For more about configuring Struts, see chapter 4. For more about ActionForwards,see chapter 6.7.2.11 The parameter propertyThe generic parameter property allows Actions to be configured at runtime. Severalof the standard Struts Actions make use of this property, and the standardScaffold Actions often use it, too. The parameter property may contain a URI, the name of a method, the name of a class, or any other bit of information an Actionmay need at runtime. This flexibility allows some Actions to do double and tripleduty, slashing the number of distinct Action classes an application needs on hand.Within an Action class, the parameter property is retrieved from the mappingpassed to perform:parameter = mapping.getParameter();Multiple parametersWhile multiple parameters are not supported by the standard ActionMappingsclass, there are some easy ways to implement this, including using HttpUtils, a StringTokenizer, or a Properties file (java.util.Properties).HttpUtils. Although deprecated as of the Servlet API 2.3 specification, theHttpUtils package (javax.servlet.http.HttpUtils) provides a static method that parses any string as if it were a query string and returns a Hashtable(java.util.Hashtable):Hashtable parameters = parseQueryString(parameter);The parameter property for your mapping then becomes just another query string, because you might use it elsewhere in the Struts configuration. stringTokenizer. Another simple approach is to delimit the parameters using the token of your choice—such as a comma, colon, or semicolon—and use the StringTokenizer to read them back:StringTokenizer incoming =new StringTokenizer(mapping.getParameter(),";");int i = 0;String[] parameters = new String[incoming.countTokens()]; while (incoming.hasMoreTokens()) {parameters[i++] = incoming.nextToken().trim();}202 CHAPTER 7Designing with ActionMappingsProperties file. While slightly more complicated than the others, another popular approach to providing multiple parameters to an ActionMapping is with a standard Properties files (java.util.Properties). Depending on your needs, the Properties file could be stored in an absolute location in your file system or anywhere on your application’s CLASSPATH.The Commons Scaffold package [ASF, Commons] provides a ResourceUtils package (mons.scaffold.util.ResourceUtils) with methods forloading a Properties file from an absolute location or from your application’s CLASSPATH.7.2.12 The attribute propertyFrom time to time, you may need to store two copies of the same ActionForm inthe same context at the same time. This most often happens when ActionFormsare being stored in the session context as part of a workflow. To keep their names from conflicting, you can use the attribute property to give one ActionForm bean a different name.An alternative approach is to define another ActionForm bean in the configuration, using the same type but under a different name.7.2.13 The prefix and suffix propertiesLike attribute, the prefix and suffix properties can be used to help avoid naming conflicts in your application. When specified, these switches enable aprefix or suffix for the property name, forming an alias when it is populatedfrom the request.If the prefix this was specified, thenthisName=McClanahanbecomes equivalent toname=McClanahanfor the purpose of populating the ActionForm. Either or both parameters would call getName("McClanahan");This does not affect how the properties are written by the tag extensions. It affects how the autopopulation mechanism perceives them in the request.Nested components 2037.2.14 The unknown ActionMappingWhile surfing the Web, most of us have encountered the dreaded 404— page not found message. Most web servers provide some special features for processing requests for unknown pages, so webmasters can steer users in the right direction. Struts offers a similar service for ActionMapping 404s—the unknown ActionMapping. In the Struts configuration file, you can specify one ActionMapping toreceive any requests for an ActionMapping that would not otherwise be matched:<actionname="/debug"forward="/pages/debug.jsp"/>When this option is not set, a request for an ActionMapping that cannot bematched throws400 Invalid path /notHere was requestedNote that by a request for an ActionMapping, we mean a URI that matches the prefix or suffix specified for the servlet (usually /do/* or *.do). Requests for other URI patterns, good or bad, will be handled by other servlets or by the container:/do/notHere (goes to the unknown ActionMapping)/notHere.txt (goes to the container)7.3 Nested componentsThe ActionMapping properties are helpful when it comes to getting an Action torun a business operation. But they tell only part of the story. There is still much todo when the Action returns.An Action may have more than one outcome. We may need to register several ActionForwards so that the Action can take its pick.7.3.1 Local forwardsIn the normal course, an ActionMapping is used to select an Action object to handle the request. The Action returns an ActionForward that indicates which pageshould complete the response.The reason we use ActionForwards is that, in practice, presentation pages areeither often reused or often changed, or both. In either case, it is good practice to encapsulate the page’s location behind a logical name, like “success” or “failure.”The ActionForward object lets us assign a logical name to any given URI.204 CHAPTER 7Designing with ActionMappingsOf course, logical concepts like success or failure are often relative. What represents success to one Action may represent failure to another. Each Action-Mapping can have its own set of local ActionForwards. When the Action asks for a forward (by name), the local set is checked before trying the global forwards. See chapter 6 for more about ActionForwards.Local forwards are usually specified in the Struts configuration file. See chapter4 for details.7.3.2 Local exceptionsMost often, an application’s exception handlers (org.apache.struts.action. ExceptionHandler) can be declared globally. However, if a given ActionMapping needs to handle an exception differently, it can have its own set of local exception handlers that are checked before the global set.Local exceptions are usually specified in the Struts configuration file. Seechapter 4 for details.7.4 Rolling your own ActionMappingWhile ActionMapping provides an impressive array of properties, developers may also provide their own subclass with additional properties or methods. InStruts 1.0, this is configured in the deployment descriptor (web.xml) for the ActionServlet:<init-param><param-name>mapping</param-name><param-value>app.MyActionMapping</param-value></init-param>In Struts 1.1, this is configured in the Struts configuration file as an attribute to the <action-mappings> element:<action-mappings type="app.MyActionMapping">Individual mappings may also be set to use another type through the className attribute:<action className="app.MyActionMapping">For more about configuring Struts, see chapter 4.SinceStruts 1.1Summary 205The framework provides two base ActionMapping classes, shown in table 7.2. They can be selected as the default or used as a base for your own subclasses.The framework default is SessionActionMapping, so scope defaults to session. Subclasses that provide new properties may set them in the Struts configuration using a standard mechanism:<set-property property="myProperty" value="myValue" /> Using this standard mechanism helps developers avoid subclassing the Action- Servlet just to recognize the new properties when it digests the configuration file. This is actually a feature of the Digester that Struts simply inherits.7.5 SummarySun’s Model 2 architecture teaches that servlets and JavaServer Pages should be used together in the same application. The servlets can handle flow control and data acquisition, and the JavaServer Pages can handle the HTML.Struts takes this one step further and delegates much of the flow control anddata acquisition to Action objects. The application then needs only a single servletto act as a traffic cop. All the real work is parceled out to the Actions and theStruts configuration objects.Like servlets, Actions are efficient, multithreaded singletons. A single Actionobject can be handling any number of requests at the same time, optimizing your server’s resources.To get the most use out of your Actions, the ActionMapping object is used as a decorator for the Action object. It gives the Action a URI, or several URIs, and away to pass different configuration settings to an Action depending on which URIis called.In this chapter, we took a close look at the ActionMapping properties andexplained each property’s role in the scheme of things. We also looked at extendingthe standard ActionMapping object with custom properties—just in case yourscheme needs even more things.Table 7.2 The default ActionMapping classesActionMapping Descriptionorg.apache.struts.action.SessionActionMapping Defaults the scope property to sessionorg.apache.struts.action.RequestActionMapping Defaults the scope property to request206 CHAPTER 7Designing with ActionMappingsIn chapter 8, the real fun begins. The configuration objects covered so far aremainly a support system. They help the controller match an incoming requestwith a server-side operation. Now that we have the supporting players, let’s meet the Struts diva: the Action object.7.1 进入ActionMappingModel 2 架构(第1章)鼓励在同一个应用中使用servlet和JSP页面。

计算机科学与技术外文翻译

计算机科学与技术外文翻译
Flash is actually capable of performing datatype conversions when necessary. However, thiscan lead to some poor coding practices on the part of ActionScript developers. For this reason,the ActionScript 2.0 standards require that you pay closer attention to the datatypes you areusing.
Working with Strings
Strings are characters or words. String values must always be enclosed in either single quotesor double quotes. Here are a few examples of strings:
In ActionScript, you’ll work with many different datatypes. However, for the sake of understandinghow these datatypes work, you can consider them in two basic categories: primitivetypes and reference types. The primitive types are called primitive because they are the basicfoundational datatypes, not because they lack importance. The reference datatypes are calledreference types because they reference the primitive types.

计算机外文翻译(完整)

计算机外文翻译(完整)

计算机外⽂翻译(完整)毕业设计(论⽂)外⽂资料翻译专业:计算机科学与技术姓名:王成明学号:06120186外⽂出处:The History of the Internet附件: 1.外⽂原⽂ 2.外⽂资料翻译译⽂;附件1:外⽂原⽂The History of the InternetThe Beginning - ARPAnetThe Internet started as a project by the US government. The object of the project was to create a means of communications between long distance points, in the event of a nation wide emergency or, more specifically, nuclear war. The project was called ARPAnet, and it is what the Internet started as. Funded specifically for military communication, the engineers responsible for ARPANet had no idea of the possibilities of an "Internet."By definition, an 'Internet' is four or more computers connected by a network.ARPAnet achieved its network by using a protocol called TCP/IP. The basics around this protocol was that if information sent over a network failed to get through on one route, it would find another route to work with, as well as establishing a means for one computer to "talk" to another computer, regardless of whether it was a PC or a Macintosh.By the 80's ARPAnet, just years away from becoming the more well known Internet, had 200 computers. The Defense Department, satisfied with ARPAnets results, decided to fully adopt it into service, and connected many military computers and resources into the network. ARPAnet then had 562 computers on its network. By the year 1984, it had over 1000 computers on its network.In 1986 ARPAnet (supposedly) shut down, but only the organization shut down, and the existing networks still existed between the more than 1000 computers. It shut down due to a failied link up with NSF, who wanted to connect its 5 countywide super computers into ARPAnet.With the funding of NSF, new high speed lines were successfully installed at line speeds of 56k (a normal modem nowadays) through telephone lines in 1988. By that time, there were 28,174 computers on the (by then decided) Internet. In 1989 there were 80,000 computers on it. By 1989, there were290,000.Another network was built to support the incredible number of people joining. It was constructed in 1992.Today - The InternetToday, the Internet has become one of the most important technological advancements in the history of humanity. Everyone wants to get 'on line' to experience the wealth of information of the Internet. Millions of people now use the Internet, and it's predicted that by the year 2003 every single person on the planet will have Internet access. The Internet has truly become a way of life in our time and era, and is evolving so quickly its hard to determine where it will go next, as computer and network technology improve every day.HOW IT WORKS:It's a standard thing. People using the Internet. Shopping, playing games,conversing in virtual Internet environments.The Internet is not a 'thing' itself. The Internet cannot just "crash." It functions the same way as the telephone system, only there is no Internet company that runs the Internet.The Internet is a collection of millioins of computers that are all connected to each other, or have the means to connect to each other. The Internet is just like an office network, only it has millions of computers connected to it.The main thing about how the Internet works is communication. How does a computer in Houston know how to access data on a computer in Tokyo to view a webpage?Internet communication, communication among computers connected to the Internet, is based on a language. This language is called TCP/IP. TCP/IP establishes a language for a computer to access and transmit data over the Internet system.But TCP/IP assumes that there is a physical connecetion between onecomputer and another. This is not usually the case. There would have to be a network wire that went to every computer connected to the Internet, but that would make the Internet impossible to access.The physical connection that is requireed is established by way of modems,phonelines, and other modem cable connections (like cable modems or DSL). Modems on computers read and transmit data over established lines,which could be phonelines or data lines. The actual hard core connections are established among computers called routers.A router is a computer that serves as a traffic controller for information.To explain this better, let's look at how a standard computer might viewa webpage.1. The user's computer dials into an Internet Service Provider (ISP). The ISP might in turn be connected to another ISP, or a straight connection into the Internet backbone.2. The user launches a web browser like Netscape or Internet Explorer and types in an internet location to go to.3. Here's where the tricky part comes in. First, the computer sends data about it's data request to a router. A router is a very high speed powerful computer running special software. The collection of routers in the world make what is called a "backbone," on which all the data on the Internet is transferred. The backbone presently operates at a speed of several gigabytes per-second. Such a speed compared to a normal modem is like comparing the heat of the sun to the heat of an ice-cube.Routers handle data that is going back and forth. A router puts small chunks of data into packages called packets, which function similarly to envelopes. So, when the request for the webpage goes through, it uses TCP/IP protocols to tell the router what to do with the data, where it's going, and overall where the user wants to go.4. The router sends these packets to other routers, eventually leadingto the target computer. It's like whisper down the lane (only the information remains intact).5. When the information reaches the target web server, the webserver then begins to send the web page back. A webserver is the computer where the webpage is stored that is running a program that handles requests for the webpage and sends the webpage to whoever wants to see it.6. The webpage is put in packets, sent through routers, and arrive at the users computer where the user can view the webpage once it is assembled.The packets which contain the data also contain special information that lets routers and other computers know how to reassemble the data in the right order.With millions of web pages, and millions of users, using the Internet is not always easy for a beginning user, especially for someone who is not entirely comfortale with using computers. Below you can find tips tricks and help on how to use main services of the Internet.Before you access webpages, you must have a web browser to actually be able to view the webpages. Most Internet Access Providers provide you with a web browser in the software they usually give to customers; you. The fact that you are viewing this page means that you have a web browser. The top two use browsers are Netscape Communicator and Microsoft Internet Explorer. Netscape can be found at /doc/bedc387343323968011c9268.html and MSIE can be found at /doc/bedc387343323968011c9268.html /ie.The fact that you're reading this right now means that you have a web browser.Next you must be familiar with actually using webpages. A webpage is a collection of hyperlinks, images, text, forms, menus, and multimedia. To "navigate" a webpage, simply click the links it provides or follow it's own instructions (like if it has a form you need to use, it will probably instruct you how to use it). Basically, everything about a webpage is made to be self-explanetory. That is the nature of a webpage, to be easily navigatable."Oh no! a 404 error! 'Cannot find web page?'" is a common remark made by new web-users.Sometimes websites have errors. But an error on a website is not the user's fault, of course.A 404 error means that the page you tried to go to does not exist. This could be because the site is still being constructed and the page hasn't been created yet, or because the site author made a typo in the page. There's nothing much to do about a 404 error except for e-mailing the site administrator (of the page you wanted to go to) an telling him/her about the error.A Javascript error is the result of a programming error in the Javascript code of a website. Not all websites utilize Javascript, but many do. Javascript is different from Java, and most browsers now support Javascript. If you are using an old version of a web browser (Netscape 3.0 for example), you might get Javascript errors because sites utilize Javascript versions that your browser does not support. So, you can try getting a newer version of your web browser.E-mail stands for Electronic Mail, and that's what it is. E-mail enables people to send letters, and even files and pictures to each other.To use e-mail, you must have an e-mail client, which is just like a personal post office, since it retrieves and stores e-mail. Secondly, you must have an e-mail account. Most Internet Service Providers provide free e-mail account(s) for free. Some services offer free e-mail, like Hotmail, and Geocities.After configuring your e-mail client with your POP3 and SMTP server address (your e-mail provider will give you that information), you are ready to receive mail.An attachment is a file sent in a letter. If someone sends you an attachment and you don't know who it is, don't run the file, ever. It could be a virus or some other kind of nasty programs. You can't get a virus justby reading e-mail, you'll have to physically execute some form of program for a virus to strike.A signature is a feature of many e-mail programs. A signature is added to the end of every e-mail you send out. You can put a text graphic, your business information, anything you want.Imagine that a computer on the Internet is an island in the sea. The sea is filled with millions of islands. This is the Internet. Imagine an island communicates with other island by sending ships to other islands and receiving ships. The island has ports to accept and send out ships.A computer on the Internet has access nodes called ports. A port is just a symbolic object that allows the computer to operate on a network (or the Internet). This method is similar to the island/ocean symbolism above.Telnet refers to accessing ports on a server directly with a text connection. Almost every kind of Internet function, like accessing web pages,"chatting," and e-mailing is done over a Telnet connection.Telnetting requires a Telnet client. A telnet program comes with the Windows system, so Windows users can access telnet by typing in "telnet" (without the "'s) in the run dialog. Linux has it built into the command line; telnet. A popular telnet program for Macintosh is NCSA telnet.Any server software (web page daemon, chat daemon) can be accessed via telnet, although they are not usually meant to be accessed in such a manner. For instance, it is possible to connect directly to a mail server and check your mail by interfacing with the e-mail server software, but it's easier to use an e-mail client (of course).There are millions of WebPages that come from all over the world, yet how will you know what the address of a page you want is?Search engines save the day. A search engine is a very large website that allows you to search it's own database of websites. For instance, if you wanted to find a website on dogs, you'd search for "dog" or "dogs" or "dog information." Here are a few search-engines.1. Altavista (/doc/bedc387343323968011c9268.html ) - Web spider & Indexed2. Yahoo (/doc/bedc387343323968011c9268.html ) - Web spider & Indexed Collection3. Excite (/doc/bedc387343323968011c9268.html ) - Web spider & Indexed4. Lycos (/doc/bedc387343323968011c9268.html ) - Web spider & Indexed5. Metasearch (/doc/bedc387343323968011c9268.html ) - Multiple searchA web spider is a program used by search engines that goes from page to page, following any link it can possibly find. This means that a search engine can literally map out as much of the Internet as it's own time and speed allows for.An indexed collection uses hand-added links. For instance, on Yahoo's site. You can click on Computers & the Internet. Then you can click on Hardware. Then you can click on Modems, etc., and along the way through sections, there are sites available which relate to what section you're in.Metasearch searches many search engines at the same time, finding the top choices from about 10 search engines, making searching a lot more effective.Once you are able to use search engines, you can effectively find the pages you want.With the arrival of networking and multi user systems, security has always been on the mind of system developers and system operators. Since the dawn of AT&T and its phone network, hackers have been known by many, hackers who find ways all the time of breaking into systems. It used to not be that big of a problem, since networking was limited to big corporate companies or government computers who could afford the necessary computer security.The biggest problem now-a-days is personal information. Why should you be careful while making purchases via a website? Let's look at how the internet works, quickly.The user is transferring credit card information to a webpage. Looks safe, right? Not necessarily. As the user submits the information, it is being streamed through a series of computers that make up the Internet backbone.The information is in little chunks, in packages called packets. Here's the problem: While the information is being transferred through this big backbone, what is preventing a "hacker" from intercepting this data stream at one of the backbone points?Big-brother is not watching you if you access a web site, but users should be aware of potential threats while transmitting private information. There are methods of enforcing security, like password protection, an most importantly, encryption.Encryption means scrambling data into a code that can only be unscrambled on the "other end." Browser's like Netscape Communicator and Internet Explorer feature encryption support for making on-line transfers. Some encryptions work better than others. The most advanced encryption system is called DES (Data Encryption Standard), and it was adopted by the US Defense Department because it was deemed so difficult to 'crack' that they considered it a security risk if it would fall into another countries hands.A DES uses a single key of information to unlock an entire document. The problem is, there are 75 trillion possible keys to use, so it is a highly difficult system to break. One document was cracked and decoded, but it was a combined effort of14,000 computers networked over the Internet that took a while to do it, so most hackers don't have that many resources available.附件2:外⽂资料翻译译⽂Internet的历史起源——ARPAnetInternet是被美国政府作为⼀项⼯程进⾏开发的。

计算机系外文翻译--历史的计算

计算机系外文翻译--历史的计算

毕业设计(论文)外文资料翻译系别计算机信息与技术系专业计算机科学与技术班级姓名学号外文出处附件 1. 原文; 2. 译文2012年3月History of computingMain article: History of computing hardwareThe first use of the word "computer" was recorded in 1613, referring to a person who carried out calculations, or computations, and the word continued with the same meaning until the middle of the 20th century. From the end of the 19th century the word began to take on its more familiar meaning, a machine that carries out computations.Limited-function early computersThe Jacquard loom, on display at the Museum of Science and Industry in Manchester, England, was one of the first programmable devices.The history of the modern computer begins with two separate technologies, automated calculation and programmability, but no single device can be identified as the earliest computer, partly because of the inconsistent application of that term. A few devices are worth mentioning though, like some mechanical aids to computing, which were very successful and survived for centuries until the advent of the electronic calculator, like the Sumerian abacus, designed around 2500 BC of which a descendant won a speed competition against a modern desk calculating machine in Japan in 1946, the slide rules, invented in the 1620s, which were carried on five Apollo space missions, including to the moon and arguably the astrolabe and the Antikythera mechanism, an ancient astronomical computer built by the Greeks around 80 BC. The Greek mathematician Hero of Alexandria (c. 10–70 AD) built a mechanical theater which performed a play lasting 10 minutes and was operated by a complex system of ropes and drums that might be considered to be a means of deciding which parts of the mechanism performed which actions and when. This is the essence of programmability.Around the end of the 10th century, the French monk Gerbert d'Aurillac brought back from Spain the drawings of a machine invented by the Moors that answered either Yes or No to the questions it was asked. Again in the 13th century, the monks Albertus Magnus and Roger Bacon built talking androids without any further development.In 1642, the Renaissance saw the invention of the mechanical calculator, a device that could perform all four arithmetic operations without relying on human intelligence. The mechanical calculator was at the root of the development ofcomputers in two separate ways. Initially, it was in trying to develop more powerful and more flexible calculators that the computer was first theorized by Charles Babbage and then developed. Secondly, development of a low-cost electronic calculator, successor to the mechanical calculator, resulted in the development by Intel of the first commercially available microprocessor integrated circuit.First general-purpose computersIn 1801, Joseph Marie Jacquard made an improvement to the textile loom by introducing a series of punched paper cards as a template which allowed his loom to weave intricate patterns automatically. The resulting Jacquard loom was an important step in the development of computers because the use of punched cards to define woven patterns can be viewed as an early, albeit limited, form of programmability.In 1837, Charles Babbage was the first to conceptualize and design a fully programmable mechanical computer, his analytical engine. Limited finances and Babbage's inability to resist tinkering with the design meant that the device was never completed ; nevertheless his son, Henry Babbage, completed a simplified version of the analytical engine's computing unit (the mill) in 1888. He gave a successful demonstration of its use in computing tables in 1906. This machine was given to the Science museum in South Kensington in 1910.In the late 1880s, Herman Hollerith invented the recording of data on a machine-readable medium. Earlier uses of machine-readable media had been for control, not data. "After some initial trials with paper tape, he settled on punched cards ..." To process these punched cards he invented the tabulator, and the keypunch machines. These three inventions were the foundation of the modern information processing industry. Large-scale automated data processing of punched cards was performed for the 1890 United States Census by Hollerith's company, which later became the core of IBM. By the end of the 19th century a number of ideas and technologies, that would later prove useful in the realization of practical computers, had begun to appear: Boolean algebra, the vacuum tube (thermionic valve), punched cards and tape, and the teleprinter.During the first half of the 20th century, many scientific computing needs were met by increasingly sophisticated analog computers, which used a direct mechanical or electrical model of the problem as a basis for computation. However, these were not programmable and generally lacked the versatility and accuracy of modern digitalcomputers.Alan Turing is widely regarded as the father of modern computer science. In 1936 Turing provided an influential formalisation of the concept of the algorithm and computation with the Turing machine, providing a blueprint for the electronic digital computer. Of his role in the creation of the modern computer, Time magazine in naming Turing one of the 100 most influential people of the 20th century, states: "The fact remains that everyone who taps at a keyboard, opening a spreadsheet or a word-processing program, is working on an incarnation of a Turing machine".EDSAC was one of the first computers to implement the stored-program (von Neumann) architecture.Die of an Intel 80486DX2 microprocessor (actual size: 12×6.75 mm) in its packaging.The Atanasoff–Berry Computer (ABC) was the world's first electronic digital computer, albeit not programmable. Atanasoff is considered to be one of the fathers of the computer.Conceived in 1937 by Iowa State College physics professor John Atanasoff, and built with the assistance of graduate student Clifford Berry, the machine was not programmable, being designed only to solve systems of linear equations. The computer did employ parallel computation. A 1973 court ruling in a patent dispute found that the patent for the 1946 ENIAC computer derived from the Atanasoff–Berry Computer.The first program-controlled computer was invented by Konrad Zuse, who built the Z3, an electromechanical computing machine, in 1941. The first programmable electronic computer was the Colossus, built in 1943 by Tommy Flowers.George Stibitz is internationally recognized as a father of the modern digital computer. While working at Bell Labs in November 1937, Stibitz invented and built a relay-based calculator he dubbed the "Model K" (for "kitchen table", on which he had assembled it), which was the first to use binary circuits to perform an arithmetic operation. Later models added greater sophistication including complex arithmetic and programmability.A succession of steadily more powerful and flexible computing devices were constructed in the 1930s and 1940s, gradually adding the key features that are seen in modern computers. The use of digital electronics (largely invented by Claude Shannon in 1937) and more flexible programmability were vitally important steps, but defining one point along this road as "the first digital electronic computer" is difficult.Notable achievements include. Konrad Zuse's electromechanical "Z machines". The Z3 (1941) was the first working machine featuring binary arithmetic, including floating point arithmetic and a measure of programmability. In 1998 the Z3 was proved to be Turing complete, therefore being the world's first operational computer.The non-programmable Atanasoff–Berry Computer (commenced in 1937, completed in 1941) which used vacuum tube based computation, binary numbers, and regenerative capacitor memory. The use of regenerative memory allowed it to be much more compact than its peers (being approximately the size of a large desk or workbench), since intermediate results could be stored and then fed back into the same set of computation elements.The secret British Colossus computers (1943), which had limited programmability but demonstrated that a device using thousands of tubes could be reasonably reliable and electronically reprogrammable. It was used for breaking German wartime codes.The Harvard Mark I (1944), a large-scale electromechanical computer with limited programmability.The U.S. Army's Ballistic Research Laboratory ENIAC (1946), which used decimal arithmetic and is sometimes called the first general purpose electronic computer (since Konrad Zuse's Z3 of 1941 used electromagnets instead of electronics). Initially, however, ENIAC had an inflexible architecture which essentially required rewiring to change its programming.Stored-program architectureReplica of the Small-Scale Experimental Machine (SSEM), the world's first stored-program computer, at the Museum of Science and Industry in Manchester, EnglandSeveral developers of ENIAC, recognizing its flaws, came up with a far more flexible and elegant design, which came to be known as the "stored-program architecture" or von Neumann architecture. This design was first formally described by John von Neumann in the paper First Draft of a Report on the EDV AC, distributed in 1945. A number of projects to develop computers based on the stored-program architecture commenced around this time, the first of which was completed in 1948 at the University of Manchester in England, the Manchester Small-Scale Experimental Machine (SSEM or "Baby"). The Electronic Delay Storage Automatic Calculator(EDSAC), completed a year after the SSEM at Cambridge University, was the first practical, non-experimental implementation of the stored-program design and was put to use immediately for research work at the university. Shortly thereafter, the machine originally described by von Neumann's paper—EDV AC—was completed but did not see full-time use for an additional two years.Nearly all modern computers implement some form of the stored-program architecture, making it the single trait by which the word "computer" is now defined. While the technologies used in computers have changed dramatically since the first electronic, general-purpose computers of the 1940s, most still use the von Neumann architecture.Beginning in the 1950s, Soviet scientists Sergei Sobolev and Nikolay Brusentsov conducted research on ternary computers, devices that operated on a base three numbering system of ?1, 0, and 1 rather than the conventional binary numbering system upon which most computers are based. They designed the Setun, a functional ternary computer, at Moscow State University. The device was put into limited production in the Soviet Union, but supplanted by the more common binary architecture.Semiconductors and microprocessorsComputers using vacuum tubes as their electronic elements were in use throughout the 1950s, but by the 1960s had been largely replaced by semiconductor transistor-based machines, which were smaller, faster, cheaper to produce, required less power, and were more reliable. The first transistorised computer was demonstrated at the University of Manchester in 1953. In the 1970s, integrated circuit technology and the subsequent creation of microprocessors, such as the Intel 4004, further decreased size and cost and further increased speed and reliability of computers. By the late 1970s, many products such as video recorders contained dedicated computers called microcontrollers, and they started to appear as a replacement to mechanical controls in domestic appliances such as washing machines. The 1980s witnessed home computers and the now ubiquitous personal computer. With the evolution of the Internet, personal computers are becoming as common as the television and the telephone in the household.Modern smartphones are fully programmable computers in their own right, and as of 2009 may well be the most common form of such computers in existenc.历史的计算主要文章:计算机硬件的历史在第一次使用“计算机”这个词被记录在1613年,指的是对一个人进行了计算,或计算,与词的意思相同,直到继续20世纪中期。

【计算机专业文献翻译】信息系统的管理

【计算机专业文献翻译】信息系统的管理
基本上每一台计算机都能连接到网络中,一台计算机要么是客户端,要么就是服务器。服务器更具强大和区别性,因为它存储了网络中其他机器需要使用的数据。个人计算机的客户端在需要数据的时候随时都可以访问服务器。网络中既是服务器又是客户端的计算机称作点对点网络。
传播媒体必须经过仔细选择,平衡每个媒体的优点和缺点,这个选择决定网络的速度。改变一个已经安装好的网络媒体通常非常昂贵。最实用的传播媒体是电缆,光纤,广播,光,红外线。
本科生毕业设计(论文)外文资料译文
(2009届)
论文题目
基于Javamail的邮件收发系统
学生姓名
学号
专业
计算机科学与技术
班级
指导教师
职称
讲师、副教授
填表日期
2008年 12月 10 日
信息科学与工程学院教务科制
外文资料翻译(译文不少于2000汉字)
1.所译外文资料:信息系统的管理Managing Information Systems
数据共享是网络的重要应用之一。网络可以共享交易数据,搜索和查询数据,信息,公告板,日历,团队和个人信息数据,备份等。在交易的时候,连接一个公司的电脑的中央数据库包括现有库存信息和出售的数据信息。如果数据被储存在一个中央数据库中,搜查结果便可从中获取。电子邮件的发送已经成为同事之间最常用的信息共享的方式之一。
自从信号在空中传输后,广播,光以及红外线作为传播媒体已经不需要电缆。
传输能力,即一个传播媒体一次性传输的数据量,在不同的媒体中,材料不同,安装时付出的劳动不同,传输的能力有很大的区别。传播媒体有时候被合并,代替远地域之间的高速传播媒体,速度虽慢,但是成本低,在一幢大楼中进行信息传播。
连接设备包括网络连接卡NICS,或者在计算机和网络间进行传输和信号传递的局域网LAN卡。其他常用的设备连接不同的网络,特别是当一个网络使用不用的传输媒体的时候。使用一个对很多用户都开放的系统很重要,比如windows/NT,Office2000,Novell,UNIX.

VisualC++ MFC简要介绍毕业设计外文翻译

VisualC++ MFC简要介绍毕业设计外文翻译

计算机专业毕业设计外文翻译Visual C++ MFC 简要介绍工学部工学一部专业计算机科学与技术班级学号姓名指导教师负责教师2008年7月Introduction to MFC Programming with Visual C++ Version 6.xby Marshall BrainVisual C++ is much more than a compiler. It is a complete application development environment that, when used as intended, lets you fully exploit the object oriented nature of C++ to create professional Windows applications. In order to take advantage of these features, you need to understand the C++ programming language. If you have never used C++, please turn to the C++ tutorials in the C/C++ Tutorials page for an introduction. You must then understand the Microsoft Foundation Class (MFC) hierarchy. This class hierarchy encapsulates the user interface portion of the Windows API, and makes it significantly easier to create Windows applications in an object oriented way. This hierarchy is available for and compatible with all versions of Windows. The code you create in MFC is extremely portable.These tutorials introduce the fundamental concepts and vocabulary behind MFC and event driven programming. In this tutorial you will enter, compile, and run a simple MFC program using Visual C++. Tutotial 2 provides a detailed explanation of the code used in Tutorial 1. Tutorial 3 discusses MFC controls and their customization. Tutorial 4 covers message maps, which let you handle events in MFC.What is the Microsoft Foundations Class Library?Let's say you want to create a Windows application. You might, for example, need to create a specialized text or drawing editor, or a program that finds files on a large hard disk, or an application that lets a user visualize the interrelationships in a big data set. Where do you begin?A good starting place is the design of the user interface. First, decide what the user should be able to do with the program and then pick a set of user interface objects accordingly. The Windows user interface has a number of standard controls, such as buttons, menus, scroll bars, and lists, that are already familiar to Windows users. With this in mind, the programmer must choose a set of controls and decide how they should be arranged on screen. A time-honored procedure is to make a rough sketch of the proposed user interface (by tradition on a napkin or the back of an envelope) and play with the elements until they feel right. For small projects, or for the early prototyping phase of a larger project, this is sufficient.The next step is to implement the code. When creating a program for any Windowsplatform, the programmer has two choices: C or C++. With C, the programmer codes at the level of the Windows Application Program Interface (API). This interface consists of a collection of hundreds of C functions described in the Window's API Reference books. For Window's NT, the API is typically referred to as the "Win32 API," to distinguish it from the original 16-bit API of lower-level Windows products like Windows 3.1.Microsoft also provides a C++ library that sits on top of any of the Windows APIs and makes the programmer's job easier. Called the Microsoft Foundation Class library (MFC), this library's primary advantage is efficiency. It greatly reduces the amount of code that must be written to create a Windows program. It also provides all the advantages normally found in C++ programming, such as inheritance and encapsulation. MFC is portable, so that, for example, code created under Windows 3.1 can move to Windows NT or Windows 95 very easily. MFC is therefore the preferred method for developing Windows applications and will be used throughout these tutorials.When you use MFC, you write code that creates the necessary user interface controls and customizes their appearance. You also write code that responds when the user manipulates these controls. For example, if the user clicks a button, you want to have code in place that responds appropriately. It is this sort of event-handling code that will form the bulk of any application. Once the application responds correctly to all of the available controls, it is finished.You can see from this discussion that the creation of a Windows program is a straightforward process when using MFC. The goal of these tutorials is to fill in the details and to show the techniques you can use to create professional applications as quickly as possible. The Visual C++ application development environment is specifically tuned to MFC, so by learning MFC and Visual C++ together you can significantly increase your power as an application developer.Windows V ocabularyThe vocabulary used to talk about user interface features and software development in Windows is basic but unique. Here we review a few definitions to make discussion easier for those who are new to the environment.Windows applications use several standard user controls:Static text labelsPush buttonsList boxesCombo boxes (a more advanced form of list)Radio boxesCheck boxesEditable text areas (single and multi-line)Scroll barsYou can create these controls either in code or through a "resource editor" that can create dialogs and the controls inside of them. In this set of tutorials we will examine how to create them in code. See the tutorials on the AppWizard and ClassWizard for an introduction to the resource editor for dialogs.Windows supports several types of application windows. A typical application will live inside a "frame window". A frame window is a fully featured main window that the user can re-size, minimize, maximize to fill the screen, and so on. Windows also supports two types of dialog boxes: modal and modeless. A modal dialog box, once on the screen, blocks input to the rest of the application until it is answered. A modeless dialog box can appear at the same time as the application and seems to "float above" it to keep from being overlaid.Most simple Windows applications use a Single Document Interface, or SDI, frame. The Clock, PIF editor, and Notepad are examples of SDI applications. Windows also provides an organizing scheme called the Multiple Document Interface, or MDI for more complicated applications. The MDI system allows the user to view multiple documents at the same time within a single instance of an application. For example, a text editor might allow the user to open multiple files simultaneously. When implemented with MDI, the application presents a large application window that can hold multiple sub-windows, each containing a document. The single main menu is held by the main application window and it applies to the top-most window held within the MDI frame. Individual windows can be iconified or expanded as desired within the MDI frame, or the entire MDI frame can be minimized into a single icon on the desktop. The MDI interface gives the impression of a second desktop out on the desktop, and it goes a long way towards organizing and removing window clutter.Each application that you create will use its own unique set of controls, its own menu structure, and its own dialog boxes. A great deal of the effort that goes into creating anygood application interface lies in the choice and organization of these interface objects. Visual C++, along with its resource editors, makes the creation and customization of these interface objects extremely easy.Event-driven Software and V ocabularyAll window-based GUIs contain the same basic elements and all operate in the same way. On screen the user sees a group of windows, each of which contains controls, icons, objects and such that are manipulated with the mouse or the keyboard. The interface objects seen by the user are the same from system to system: push buttons, scroll bars, icons, dialog boxes, pull down menus, etc. These interface objects all work the same way, although some have minor differences in their "look and feel." For example, scroll bars look slightly different as you move from Windows to the Mac to Motif, but they all do the same thing.From a programmer's standpoint, the systems are all similar in concept, although they differ radically in their specifics. To create a GUI program, the programmer first puts all of the needed user interface controls into a window. For example, if the programmer is trying to create a simple program such as a Fahrenheit to Celsius converter, then the programmer selects user interface objects appropriate to the task and displays them on screen. In this example, the programmer might let the user enter a temperature in an editable text area, display the converted temperature in another un-editable text area, and let the user exit the program by clicking on a push-button labeled "quit".As the user manipulates the application's controls, the program must respond appropriately. The responses are determined by the user's actions on the different controls using the mouse and the keyboard. Each user interface object on the screen will respond to events differently. For example, if the user clicks the Quit button, the button must update the screen appropriately, highlighting itself as necessary. Then the program must respond by quitting. Normally the button manages its appearance itself, and the program in some way receives a message from the button that says, "The quit button was pressed. Do something about it." The program responds by exiting.Windows follows this same general pattern. In a typical application you will create a main window and place inside it different user interface controls. These controls are often referred to as child windows-each control is like a smaller and more specialized sub-window inside the main application window. As the application programmer, youmanipulate the controls by sending messages via function calls, and they respond to user actions by sending messages back to your code.If you have never done any "event-driven" programming, then all of this may seem foreign to you. However, the event-driven style of programming is easy to understand. The exact details depend on the system and the level at which you are interfacing with it, but the basic concepts are similar. In an event-driven interface, the application paints several (or many) user interface objects such as buttons, text areas, and menus onto the screen. Now the application waits-typically in a piece of code called an event loop-for the user to do something. The user can do anything to any of the objects on screen using either the mouse or the keyboard. The user might click one of the buttons, for example. The mouse click is called an event. Event driven systems define events for user actions such as mouse clicks and keystrokes, as well as for system activities such as screen updating.At the lowest level of abstraction, you have to respond to each event in a fair amount of detail. This is the case when you are writing normal C code directly to the API. In such a scenario, you receive the mouse-click event in some sort of structure. Code in your event loop looks at different fields in the structure, determines which user interface object was affected, perhaps highlights the object in some way to give the user visual feedback, and then performs the appropriate action for that object and event. When there are many objects on the screen the application becomes very large. It can take quite a bit of code simply to figure out which object was clicked and what to do about it.Fortunately, you can work at a much higher level of abstraction. In MFC, almost all these low-level implementation details are handled for you. If you want to place a user interface object on the screen, you create it with two lines of code. If the user clicks on a button, the button does everything needed to update its appearance on the screen and then calls a pre-arranged function in your program. This function contains the code that implements the appropriate action for the button. MFC handles all the details for you: You create the button and tell it about a specific handler function, and it calls your function when the user presses it. Tutorial 4 shows you how to handle events using message maps An ExampleOne of the best ways to begin understanding the structure and style of a typical MFC program is to enter, compile, and run a small example. The listing below contains a simple "hello world" program. If this is the first time you've seen this sort of program, it probablywill not make a lot of sense initially. Don't worry about that. We will examine the code in detail in the next tutorial. For now, the goal is to use the Visual C++ environment to create, compile and execute this simple program.//hello.cpp#include <afxwin.h>// Declare the application classclass CHelloApp : public CWinApp{public:virtual BOOL InitInstance();};// Create an instance of the application classCHelloApp HelloApp;// Declare the main window classclass CHelloWindow : public CFrameWnd{CStatic* cs;public:CHelloWindow();};// The InitInstance function is called each// time the application first executes.BOOL CHelloApp::InitInstance(){m_pMainWnd = new CHelloWindow();m_pMainWnd->ShowWindow(m_nCmdShow);m_pMainWnd->UpdateWindow();return TRUE;}// The constructor for the window classCHelloWindow::CHelloWindow(){// Create the window itselfCreate(NULL,"Hello World!",WS_OVERLAPPEDWINDOW,CRect(0,0,200,200));// Create a static labelcs = new CStatic();cs->Create("hello world",WS_CHILD|WS_VISIBLE|SS_CENTER,CRect(50,80,150,150),this);}This small program does three things. First, it creates an "application object." Every MFC program you write will have a single application object that handles the initialization details of MFC and Windows. Next, the application creates a single window on the screen to act as the main application window. Finally, inside that window the application creates a single static text label containing the words "hello world". We will look at this program in detail in the next tutorial to gain a complete understanding of its structure.The steps necessary to enter and compile this program are straightforward. If you have not yet installed Visual C++ on your machine, do so now. You will have the option of creating standard and custom installations. For the purposes of these tutorials a standard installation is suitable and after answering two or three simple questions the rest of the installation is quick and painless.Start VC++ by double clicking on its icon in the Visual C++ group of the Program Manager. If you have just installed the product, you will see an empty window with a menu bar. If VC++ has been used before on this machine, it is possible for it to come up in several different states because VC++ remembers and automatically reopens the project and files in use the last time it exited. What we want right now is a state where it has no project or code loaded. If the program starts with a dialog that says it was unable to find a certain file, clear the dialog by clicking the "No" button. Go to the Window menu and select the Close All option if it is available. Go to the File menu and select the Close option if it is available to close any remaining windows. Now you are at the proper starting point.If you have just installed the package, you will see a window that looks something like this:This screen can be rather intimidating the first time you see it. To eliminate some ofthe intimidation, click on the lower of the two "x" buttons () that you see in the upper right hand corner of the screen if it is available. This action will let you close the "InfoViewer Topic" window. If you want to get rid of the InfoViewer toolbar as well, you can drag it so it docks somewhere along the side of the window, or close it and later get it back by choosing the Customize option in the Tools menu.What you see now is "normal". Along the top is the menu bar and several toolbars. Along the left side are all of the topics available from the on-line book collection (you might want to explore by double clicking on several of the items you see there - the collection of information found in the on-line books is gigantic). Along the bottom is a status window where various messages will be displayed.Now what? What you would like to do is type in the above program, compile it and run it. Before you start, switch to the File Manager (or the MS-DOS prompt) and make sure your drive has at least five megabytes of free space available. Then take the following steps.Creating a Project and Compiling the CodeIn order to compile any code in Visual C++, you have to create a project. With a very small program like this the project seems like overkill, but in any real program the projectconcept is quite useful. A project holds three different types of information: It remembers all of the source code files that combine together to create one executable. In this simple example, the file HELLO.CPP will be the only source file, but in larger applications you often break the code up into several different files to make it easier to understand (and also to make it possible for several people to work on it simultaneously). The project maintains a list of the different source files and compiles all of them as necessary each time you want to create a new executable.It remembers compiler and linker options particular to this specific application. For example, it remembers which libraries to link into the executable, whether or not you want to use pre-compiled headers, and so on.It remembers what type of project you wish to build: a console application, a windows application, etc.If you are familiar with makefiles, then it is easy to think of a project as a machine-generated makefile that has a very easy-to-understand user interface to manipulate it. For now we will create a very simple project file and use it to compile HELLO.CPP.To create a new project for HELLO.CPP, choose the New option in the File menu. Under the Projects tab, highlight Win32 Application. In the Location field type an appropriate path name or click the Browse button. Type the word "hello" in for the project name, and you will see that word echoed in the Location field as well. Click the OK button. In the next window, use the default selection "An empty project", click "Finish", then click "OK" once more in the next window. Notice there is an option for the typical "Hello World" application, however it skips a few important steps you are about to take. Visual C++ will create a new subdirectory named HELLO and place the project files named HELLO.OPT, HELLO.NCB, HELLO.DSP, and HELLO.DSW in that directory. If you quit and later want to reopen the project, double-click on HELLO.DSW.The area along the left side of the screen will now change so that three tabs are available. The InfoView tab is still there, but there is now also a ClassView and a FileView tab. The ClassView tab will show you a list of all of the classes in your application and the FileView tab gives you a list of all of the files in the project.Now it is time to type in the code for the program. In the File menu select the New option to create a new editor window. In the dialog that appears, make sure the Files tab isactive and request a "C++ Source File". Make sure the "Add to Project" option is checked for Project "hello", and enter "hello" for "File name". Visual C++ comes with its own intelligent C++ editor, and you will use it to enter the program shown above. Type (copy/paste) the code in the listing into the editor window. You will find that the editor automatically colors different pieces of text such as comments, key words, string literals, and so on. If you want to change the colors or turn the coloring off, go to the Options option in the Tools menu, choose the Format tab and select the Source Windows option from the left hand list. If there is some aspect of the editor that displeases you, you may be able to change it using the Editor tab of the Options dialog.After you have finished entering the code, save the file by selecting the Save option in the File menu. Save it to a file named HELLO.CPP in the new directory Visual C++ created.In the area on the left side of the screen, click the FileView tab and expand the tree on the icon labeled "hello files", then expand the tree on the folder icon labeled "Source Files". You will see the file named HELLO.CPP. Click on the ClassView tab and expand the "hello classes" tree and you will see the classes in the application. You can remove a file from a project at any time by going to the FileView, clicking the file, and pressing the delete button.Finally, you must now tell the project to use the MFC library. If you omit this step the project will not link properly, and the error messages that the linker produces will not help one bit. Choose the Settings option in the Project menu. Make sure that the General tab is selected in the tab at the top of the dialog that appears. In the Microsoft Foundation Classes combo box, choose the third option: "Use MFC in a Shared DLL." Then close the dialog.Having created the project file and adjusted the settings, you are ready to compile the HELLO.CPP program. In the Build menu you will find three different compile options: Compile HELLO.CPP (only available if the text window for HELLO.CPP has focus) Build HELLO.EXERebuild AllThe first option simply compiles the source file listed and forms the object file for it. This option does not perform a link, so it is useful only for quickly compiling a file to check for errors. The second option compiles all of the source files in the project that have been modified since the last build, and then links them to form an executable. The thirdoption recompiles all of the source files in the project and relinks them. It is a "compile and link from scratch" option that is useful after you change certain compiler options or move to a different platform.In this case, choose the Build HELLO.EXE option in the Build menu to compile and link the code. Visual C++ will create a new subdirectory named Debug and place the executable named HELLO.EXE in that new subdirectory. This subdirectory holds all disposable (easily recreated) files generated by the compiler, so you can delete this directory when you run short on disk space without fear of losing anything important.If you see compiler errors, simply double click on the error message in the output window. The editor will take you to that error. Compare your code against the code above and fix the problem. If you see a mass of linker errors, it probably means that you specified the project type incorrectly in the dialog used to create the project. You may want to simply delete your new directory and recreate it again following the instructions given above exactly.To execute the program, choose the Execute HELLO.EXE option in the Build menu.A window appears with the words "hello world". The window itself has the usual decorations: a title bar, re-size areas, minimize and maximize buttons, and so on. Inside the window is a static label displaying the words "hello world". Note that the program is complete. You can move the window, re-size it, minimize it, and cover and uncover it with other windows. With a very small amount of code you have created a complete Window application. This is one of the many advantages of using MFC. All the details are handled elsewhere.Visual C++ MFC 简要介绍原著:Marshall Brain Visual C++ 不仅仅是一个编译器。

毕业设计论文外文文献翻译计算机科学与技术微软VisualStudio中英文对照

毕业设计论文外文文献翻译计算机科学与技术微软VisualStudio中英文对照

外文文献翻译(2012届)学生姓名学号********专业班级计算机科学与技术08-5班指导教师微软Visual Studio1微软Visual StudioVisual Studio 是微软公司推出的开发环境,Visual Studio可以用来创建Windows平台下的Windows应用程序和网络应用程序,也可以用来创建网络服务、智能设备应用程序和Office 插件。

Visual Studio是一个来自微软的集成开发环境IDE(inteqrated development environment),它可以用来开发由微软视窗,视窗手机,Windows CE、.NET框架、.NET精简框架和微软的Silverlight支持的控制台和图形用户界面的应用程序以及Windows窗体应用程序,网站,Web应用程序和网络服务中的本地代码连同托管代码。

Visual Studio包含一个由智能感知和代码重构支持的代码编辑器。

集成的调试工作既作为一个源代码级调试器又可以作为一台机器级调试器。

其他内置工具包括一个窗体设计的GUI应用程序,网页设计师,类设计师,数据库架构设计师。

它有几乎各个层面的插件增强功能,包括增加对支持源代码控制系统(如Subversion和Visual SourceSafe)并添加新的工具集设计和可视化编辑器,如特定于域的语言或用于其他方面的软件开发生命周期的工具(例如Team Foundation Server的客户端:团队资源管理器)。

Visual Studio支持不同的编程语言的服务方式的语言,它允许代码编辑器和调试器(在不同程度上)支持几乎所有的编程语言,提供了一个语言特定服务的存在。

内置的语言中包括C/C + +中(通过Visual C++),(通过Visual ),C#中(通过Visual C#)和F#(作为Visual Studio 2010),为支持其他语言,如M,Python,和Ruby等,可通过安装单独的语言服务。

外文翻译---基于网络的教学系统

外文翻译---基于网络的教学系统

毕业设计(论文)外文资料翻译系别:计算机系专业:计算机科学与技术班级:姓名:学号:外文出处:Web-Based Network education System1. IntroductionComputers and web applications bring a significant revolution in our social life and especially to our traditional mechanism of education. The era of education enable us to access mass of information whose remarkable character is digital so that computers can recognize and deal with this kind of expression of information. Digital campus construction is already on going in order to catch the new trend in quality education. The main functions of digital campus cover with distance such as web classroom, courseware on demand, distance examination. The digital campus information management system includes information management system, office automation system, administration examination system and virtual community such as online tutoring, bulletin board system etc. With the intensification of distance web education, how to estimate learning effect locally is an important issue. A comprehensive education system which utilizes information technology of the network to carry on college course to educate, it offers from the network classroom, essential study links discussing, answering questions, and processing homework to examination to teachers and students. This system should also support management activity of the educational administration, such as online course project, roll management, follow-up of quality. The self-adapted examination system is a sub-system of the Networking Institute's demonstration project. In Internet Universal, distance learning is by telephone, television, video and communications, asynchronous transmission mode of teaching information. In recent years, based on the introduction Internet Distance learning, World Wide Web Recognized as the most powerful curriculum information dissemination media, the Internet has hundreds of courses, there are more schools and teachers are being considered for Web Teaching. For Web Teaching, and that is using the World Wide Web as a teaching medium, transmission teaching in the implementation of online teaching, teaching management, and online testing and online exchanges. Realistic and complete implementation based on Web Teaching requires a user-friendly and efficient support online teaching platform support. Currently there are some in the international market such products, such as Lotus Company Learning Space , the British Columbia University computer science department development Web CT ,WBT System Company Top Class And Canada Simon Fraser University development Virtual. Many companies and schools are also being developed or is ready to develop similar software, such as the key institutions in preparation for the development of modern distancelearning and teaching support system. Online teaching platform should be aware of the support functions, which can or should provide the ancillary support, all of which feature current products, for effective online teaching is very important.2.The main characteristicTeachers can keep a student's screens' voice display and send information to all students or a group of broadcast; teachers can watch and listen to a student 's information, and control the student's keyboard and mouse , and do "hand in hand" type of guidance, and arbitrary switching among students ; and remote window control guidance, the window of multimedia network classroom software can control the intelligent rolling and teachers teaching in various other functions at the same time, the teacher can remote control machine on a number of students at the same time and also can let all (a group or a) student screens arranged in "the black screen", and lock the keyboard and mouse, reminding the attention of students; intelligent rolling screen: the screen broadcast and remote control operation uses the original smart scroll, free rolling technology, which need not undertake screen scaling, receiving students in the broadcast in the process of watching the operation; the mouse capture: it supports soft cursor, animated mouse cursor, mouse cursor broadcasting, even in windowed mode which can reflect the real-time changes in morphology and mouse; multi-point monitoring: multimedia network classroom software support multiple windows simultaneously with the same When the watch, which can also watch window distributed across multiple machines, real-time monitoring of all the other students in the state machine; broadcast: multimedia network classroom software support more audio and video file formats, support for VCD, MP3, W AV and other documents play online ; automatic login: students on the machine automatically log in the teacher machine; multimedia network classroom software has strong system stability, ensure the teaching process smoothly; perfect functions, beautiful interface which is easy to use the direct and concise operation, using the unified mode of operation; software, multimedia network classroom software does not need a server, simple installation, convenient upgrade and maintenance; hardware compatibility: multimedia network classroom software contents all the card, sound card, display card and can demonstrate good performance, and won't appear any unstable phenomenon.3. Design multimedia network classroom of thoughtIn the multimedia network classroom design, it focuses on solving the user pays as the following issues: (1)the multimedia network classroom is easy to use and individualized demand. Because each teacher for computer to different extent, teachers need to multimedia network classroom is simple and easy to use, one will see, will soon be able to undertake informatizal teaching. The computer master degree higher teacher needs according to computer and information understanding, personalized teaching.(2) multimedia network classroom and practicalteaching function. Information teaching is a means of teaching, its purpose is to improve the effect of teaching. This means whether the teaching habits, whether there is a wealth of practical teaching function, really help teachers for teaching, improve the effect of teaching has become the most concern of the teacher.(3)multimedia network classroom teaching management function. If a student who attends class does not listen to the teacher carefully, has nothing to do with the classroom things, such as playing games, or simply add or remove programs are headaches in teachers teaching; and in order to guarantee the teaching effection carrying smoothly, it also requires a corresponding teaching management function to assist.4.The multimedia network classroom program advantagesMultimedia network classroom solution has the following advantages.(1)Simple and easy to use, multimedia network classroom software use a graphical interface, whoes each function has a corresponding button, operating on a stick out a mile, so that teachers can see use it easily. (2)Flexible customized, which meets the demand of personal teaching. The teacher can customize multimedia network classroom software interface, icon, toolbar and also can customize the class model at the same time by using multimedia network classroom run concurrent design, each function of teaching can manage any combination and arbitrary. (3)Multimedia network classroom original thumbnail display mode which can make the whole class of the students computer screen contents show to teachers at the same time and let teachers watch easily in global.(4)practical teaching function of multimedia network classroom software offers practical and rich pedagogical features, including screen broadcasting, video broadcasting, voice broadcasting, issued procedures, and collection operations.(5)Supporting a variety of teaching strategies, which can use the broadcast function to broadcast the teacher's own screen to everyone.(6)teaching management function in the multimedia network classroom, which is subject to the control of the teacher, students can be remotely set machine, and the multimedia network classroom is also enhanced by many teachers and students interaction, such as "remote control", which fully ensured between student and teacher interaction.(7)In order to guarantee the teaching carrying out smoothly, the teacher wants multimedia network classroom software to help manage the students' situation. Multimedia network classroom software is provided for locking the computer black screen and hush functions(8) Multimedia network classroom daily maintenance workload is very big, the teacher does not have too much time to manage multimedia network classroom maintenance, hoping multimedia network classroom software can provide very good maintenance function. Multimedia network classroom with remote settings, document publishing, charge, delete, remote command, remote control and other functions.(9)multimedia network classroom software has strong system stability, high soft, hardware environment compatibility, regardless of level of computer configuration, graphics cards, sound card type, which can guarantee the normal operation of multimedia network classroom.(10)because of the multimedia network classroom is a pure software implementation, simple installation,upgrade and maintenance which is very convenient.5. The main functions of software in multimedia network teaching(1)Teaching function, including screen broadcasting, screen monitoring, voice broadcast, audio monitor, video broadcasting, electronic drawing board, news release, issued a document, collect documents, documents and other functions which the teacher in the class is the most commonly used functions.(2)Teaching management, multimedia network Teaching management function can ensure the teaching be carried out smoothly, including the class model, group management, call sign, lock computer, silent, black screen log. (3)Maintenance, for the convenience of teachers to multimedia classroom network maintenance, multimedia network teaching provides remote settings and other functions.6. Multimedia network teaching system buildingMultimedia network classroom is a small LAN environment, generally uses the 100M switching to the desktop, you can ensure that the audio and video files well transmission. Computer selection of good effects and economic benefits principle, selection of the computer multimedia network classroom should let the minimum guarantee the smooth operation of multimedia courseware, and commonly used methods of software, such as Word, Powerpoint, teacher's machine configuration is higher than the students machine configuration , and the best buying support WOL function computer.Finally the teacher machine, student machine, switching with twisted pair link, which sets the TCP / IP protocol, transfering through network, should instals on the multimedia network classroom software and a complete multimedia network classroom building.基于网络的教学系统1导言计算机和网络应用带来了重大变革,我们的社会生活,特别是我们的传统机制的教育得到了重大变革。

计算机科学与技术的作文

计算机科学与技术的作文

计算机科学与技术的作文英文回答:Computer science and technology refer to the study, development, application, and maintenance of computer systems and applications. It encompasses various domains within the broader field of information technology (IT), including hardware, software, networks, security, databases, and artificial intelligence (AI).Computer science involves the theoretical foundationsof computation, algorithms, and data structures, while computer technology focuses on the practical implementation and deployment of these concepts. In essence, the two disciplines complement each other, with computer science providing the intellectual framework and computertechnology enabling its realization.Advancements in computer science and technology have profoundly impacted modern society, transforming the way welive, work, and interact with the world. From personal computing to enterprise data centers, from the internet to mobile devices, computers have become ubiquitous and indispensable.中文回答:计算机科学与技术是指研究、开发、应用和维护计算机系统和应用程序。

计算机科学与技术Java垃圾收集器中英文对照外文翻译文献

计算机科学与技术Java垃圾收集器中英文对照外文翻译文献

中英文资料中英文资料外文翻译文献原文:How a garbage collector works of Java LanguageIf you come from a programming language where allocating objects on the heap is expensive, you may naturally assume that Java’s scheme of allocating everything (except primitives) on the heap is also expensive. However, it turns out that the garbage collector can have a significant impact on increasing the speed of object creation. This might sound a bit odd at first—that storage release affects storage allocation—but it’s the way some JVMs work, and it means that allocating storage for heap objects in Java can be nearly as fast as creating storage on the stack in other languages.For example, you can think of the C++ heap as a yard where each stakes out its own piece of turf object. This real estate can become abandoned sometime later and must be reused. In some JVMs, the Java heap is quite different; it’s more like a conveyor belt that moves forwardevery time you allocate a new object. This means that object storage allocation is remarkab ly rapid. The “heap pointer” is simply moved forward into virgin territory, so it’s effectively the same as C++’s stack allocation. (Of course, there’s a little extra overhead for bookkeeping, but it’s nothing like searching for storage.)You might observ e that the heap isn’t in fact a conveyor belt, and if you treat it that way, you’ll start paging memory—moving it on and off disk, so that you can appear to have more memory than you actually do. Paging significantly impacts performance. Eventually, after you create enough objects, you’ll run out of memory. The trick is that the garbage collector steps in, and while it collects the garbage it compacts all the objects in the heap so that you’ve effectively moved the “heap pointer” closer to the beginning of the conveyor belt and farther away from a page fault. The garbage collector rearranges things and makes it possible for the high-speed, infinite-free-heap model to be used while allocating storage.To understand garbage collection in Java, it’s helpful le arn how garbage-collection schemes work in other systems. A simple but slow garbage-collection technique is called reference counting. This means that each object contains a reference counter, and every time a reference is attached to that object, the reference count is increased. Every time a reference goes out of scope or is set to null, the reference count isdecreased. Thus, managing reference counts is a small but constant overhead that happens throughout the lifetime of your program. The garbage collector moves through the entire list of objects, and when it finds one with a reference count of zero it releases that storage (however, reference counting schemes often release an object as soon as the count goes to zero). The one drawback is that if objects circularly refer to each other they can have nonzero reference counts while still being garbage. Locating such self-referential groups requires significant extra work for the garbage collector. Reference counting is commonly used to explain one kind of g arbage collection, but it doesn’t seem to be used in any JVM implementations.In faster schemes, garbage collection is not based on reference counting. Instead, it is based on the idea that any non-dead object must ultimately be traceable back to a reference that lives either on the stack or in static storage. The chain might go through several layers of objects. Thus, if you start in the stack and in the static storage area and walk through all the references, you’ll find all the live objects. For each reference that you find, you must trace into the object that it points to and then follow all the references in that object, tracing into the objects they point to, etc., until you’ve moved through the entire Web that originated with the reference on the stack or in static storage. Each object that you move through must still be alive. Note that there is no problem withdetached self-referential groups—these are simply not found, and are therefore automatically garbage.In the approach described here, the JVM uses an adaptive garbage-collection scheme, and what it does with the live objects that it locates depends on the variant currently being used. One of these variants is stop-and-copy. This means that—for reasons that will become apparent—the program is first stopped (this is not a background collection scheme). Then, each live object is copied from one heap to another, leaving behind all the garbage. In addition, as the objects are copied into the new heap, they are packed end-to-end, thus compacting the new heap (and allowing new storage to simply be reeled off the end as previously described).Of course, when an object is moved from one place to another, all references that point at the object must be changed. The reference that goes from the heap or the static storage area to the object can be changed right away, but there can be other references pointing to this object Initialization & Cleanup that will be encountered later during the “walk.” These are fixed up as they are found (you could imagine a table that maps old addresses to new ones).There are two issues that make these so-called “copy collectors” inefficient. The first is the idea that you have two heaps and you slosh all the memory back and forth between these two separate heaps,maintaining twice as much memory as you actually need. Some JVMs deal with this by allocating the heap in chunks as needed and simply copying from one chunk to another.The second issue is the copying process itself. Once your program becomes stable, it might be generating little or no garbage. Despite that, a copy collector will still copy all the memory from one place to another, which is wasteful. To prevent this, some JVMs detect that no new garbage is being generated and switch to a different scheme (this is the “adaptive” part). This other scheme is called mark-and-sweep, and it’s what earlier versions of Sun’s JVM used all the time. For general use, mark-and-sweep is fairly slow, but when you know you’re generating little or no garbage, it’s fast. Mark-and-sweep follows the same logic of starting from the stack and static storage, and tracing through all the references to find live objects.However, each time it finds a live object, that object is marked by setting a flag in it, but the object isn’t collected yet.Only when the marking process is finished does the sweep occur. During the sweep, the dead objects are released. However, no copying happens, so if the collector chooses to compact a fragmented heap, it does so by shuffling objects around. “Stop-and-copy”refers to the idea that this type of garbage collection is not done in the background; Instead, the program is stopped while the garbage collection occurs. In the Sun literature you’llfind many references to garbage collection as a low-priority background process, but it turns out that the garbage collection was not implemented that way in earlier versions of the Sun JVM. Instead, the Sun garbage collector stopped the program when memory got low. Mark-and-sweep also requires that the program be stopped.As previously mentioned, in the JVM described here memory is allocated in big blocks. If you allocate a large object, it gets its own block. Strict stop-and-copy requires copying every live object from the source heap to a new heap before you can free the old one, which translates to lots of memory. With blocks, the garbage collection can typically copy objects to dead blocks as it collects. Each block has a generation count to keep track of whether it’s alive. In the normal case, only the blocks created since the last garbage collection are compacted; all other blocks get their generation count bumped if they have been referenced from somewhere. This handles the normal case of lots of short-lived temporary objects. Periodically, a full sweep is made—large objects are still not copied (they just get their generation count bumped), and blocks containing small objects are copied and compacted.The JVM monitors the efficiency of garbage collection and if it becomes a waste of time because all objects are long-lived, then it switches to mark-and sweep. Similarly, the JVM keeps track of how successful mark-and-sweep is, and if the heap starts to becomefragmented, it switches back to stop-and-copy. This is where the “adaptive” part comes in, so you end up with a mouthful: “Adaptive generational stop-and-copy mark-and sweep.”There are a number of additional speedups possible in a JVM. An especially important one involves the operation of the loader and what is called a just-in-time (JIT) compiler. A JIT compiler partially or fully converts a program into native machine code so that it doesn’t need to be interpreted by the JVM and thus runs much faster. When a class must be loaded (typically, the first time you want to create an object of that class), the .class file is located, and the byte codes for that class are brought into memory. At this point, one approach is to simply JIT compile all the code, but this has two drawbacks: It takes a little more time, which, compounded throughout the life of the program, can add up; and it increases the size of the executable (byte codes are significantly more compact than expanded JIT code), and this might cause paging, which definitely slows down a program. An alternative approach is lazy evaluation, which means that the code is not JIT compiled until necessary. Thus, code that never gets executed might never be JIT compiled. The Java Hotspot technologies in recent JDKs take a similar approach by increasingly optimizing a piece of code each time it is executed, so the more the code is executed, the faster it gets.译文:Java垃圾收集器的工作方式如果你学下过一种因为在堆里分配对象所以开销过大的编程语言,很自然你可能会假定Java 在堆里为每一样东西(除了primitives)分配内存资源的机制开销也会很大。

计算机毕业设计外文翻译-- 电路交换网与vb调用数据库

计算机毕业设计外文翻译-- 电路交换网与vb调用数据库
电路交换和包交换的最后一个不同点是计费方式。电路交换的计费是按照传统的距离和时间的。比如移动电话除打国际电话外距离是不列入计算的,而时间也只是列入一个简单的计算(例:拔打2000分钟电话比1000分钟电话花费的多并且晚上或周末也比平时来得便宜)。时间对于包交换来说是没有问题的,但是传输流量却是个问题。ISPs为家庭用户的计费方式基于按一个月的流量的一半的,这是因为它们用得相对较少并且他们的顾客也很好理解这种计费方式。但是主干网络中心的收费是基于它们的流量的。这些不同列在图2-40里。
即使美国拥有移动电话的所有权,但是在应用上欧洲要远远超过美国的。原因之一就是整个欧洲拥有相同的简单系统。然而更多的是由于美国和欧洲的基本电话数量不同。在美国移动电话和固定电话是共用的,因此对于用户没有办法区分(212)234-5678到底是固定电话(拨打是便宜的或者是免费的)还是移动电话(拨打是昂贵的)。为了使人们从使用电话中获益,电话公司决定为引入呼叫而花自己的钱制造移动电话。结果导致,很多人怕由于呼叫而收到一大笔帐单而不愿意买移动电话。在欧洲移动电话有特殊的区号(如800,900之类的数字),所以它很快就得到了认可。因而在一般的“叫方付费”的原则在欧洲也被应用于移动电话了(除国际电话分开收费外)。
毕业设计(论文)外文资料翻译
专业班级:计算机科学与技术
外文来源一:网络文摘<<源码天空>>
外文来源二:
指导教师评语:
签名:

切换电路的连接设置的结果是保留了从发送端到接收端的包所通过的线路带宽。其它的特性这一就是所有的包都沿同一个线路意味着如果包传输超过了时序那它将不能到达接收端.由于没有路径用来进行包交换,所以要想不同的包沿不同的路径传送就是能依靠网络的条件了。这样包即便是超过了时序它们也有可能到达的。

计算机科学说明文英语作文

计算机科学说明文英语作文

计算机科学说明文英语作文英文回答:Computer science is the study of computation and information. It encompasses a wide range of topics, from theoretical foundations to practical applications. Computer scientists develop the algorithms, software, and hardware that power our modern world.There are two main branches of computer science: theoretical computer science and practical computer science. Theoretical computer science explores the fundamental principles of computation, such as the limits ofcomputation and the complexity of algorithms. Practical computer science focuses on the design and implementationof computer systems, including software engineering, operating systems, and computer architecture.Computer science is a rapidly evolving field, with new technologies and applications emerging all the time. Someof the most exciting recent advances in computer science include the development of artificial intelligence, machine learning, and quantum computing. These technologies have the potential to revolutionize many aspects of our lives, from the way we work and communicate to the way we learn and understand the world around us.Computer science is a challenging but rewarding field. It requires a strong foundation in mathematics and logical reasoning, as well as a passion for technology and problem-solving. Computer scientists are in high demand in today's job market, and they can work in a variety of industries, including technology, healthcare, finance, and government.If you are interested in a career in computer science, there are many resources available to help you get started. You can take classes at your local school or university, or you can find online courses and tutorials. There are also many clubs and organizations that support students and professionals in computer science.中文回答:计算机科学是计算和信息的研究。

计算机外文翻译---J2ME和JAVA领域

计算机外文翻译---J2ME和JAVA领域

毕业设计(论文)外文资料翻译系:计算机系专业:计算机科学与技术姓名:学号:外文出处:JAVA 2 Micro Edition and the World(用外文写)of JAVA[EB/OL].[2012-02-28].http:///view/7e71db9c51e79b8968022609.html附件: 1.外文资料翻译译文;2.外文原文。

附件1:外文资料翻译译文J2ME和JAVA领域1.介绍20世纪70年代以来随着计算机革命的开始,对计算机先进软件的需求大大增加,从而可以充分利用功能日益增强的精密的计算机的处理数据的能力。

C编程语言逐渐成为支柱,使程序员开发软件像计算机运行一样流畅。

80年代以来,程序员又目睹了编程语言领域的又一次变革的高潮。

C语言的编程能力已经不能满足计算机的技术发展的需要。

这问题并不是新问题。

它造成了一代又一代的编程语言的新老更替。

问题是,它使得程序设计过于复杂,从而使计算机软件的设计,编写和开发落后于硬件的发展。

就是这个时候,两种基于设计概念的编程语言Simula 67和Smalltalk(从上世纪60年代末)带来了接近编程语言未来前景的循序渐进的步骤。

这期间,当面向对象编程(OOP),与它一种新的编程语言,所谓的C++在程序员中掀起了一场风暴。

1979年,Bjarne Stroustrup的在新泽西州的贝尔实验室增强了C 语言,使其具有面向对象的特点即所谓的C++语言 (++是C编程语言增强的承载符号)。

C++是一个真正的提高的C编程语言,它开始是一种前置语言,该计划最初是一种编译工具。

St roustrup建立类的概念(借用了Simula 67和Smalltalk中的概念),由类则可以创建实例对象。

一个类包含数据成员和定义对象数据和功能的成员函数。

他还介绍了继承的概念,使一类继承其他一个或多个类的部分或全部数据成员或成员函数,职能由一个或多个其他类别-所有这些概念就是面向对象的编程。

计算机科学与技术专业外文翻译--计算机与制造业

计算机科学与技术专业外文翻译--计算机与制造业

外文原文:The Computer and ManufacturingThe computer is bringing manufactuing into the Information Age.This new tool, long a familiar one in business and management operation, is moving into the factory, and its advent is changing manufacturing as certainly as the stean engine changed it more than 200 years ago.The basic metalworking processes are not likely to change fundamentally, but their organization and contral definitely will.In one respect , manufacturing could be said to be coming full circle. The first manufacturing was a cottage industry: the designer was also the manufacturer, conceiving and fabricating products one at a time.Eventually,the concept of the interchangeability of parts was developed, producted thousanda at a time.Today , although the designer and manufacturer may not become one again, the functions are being drawn close in the movement toward an integrated manufacturing system.It ia perhaps ironic that, at a time when the market demands a hinh degree of product diversification, the manufacturing enteprises have to increase productivity and reduce costs, Customers are demanding hinh quality and diversified products for less money.The computer is the key to meet these requirements. It is the only tool that can provide the quick reflexes, the flexibility and speed, to meet a diversified market. And it is the only tool that enables the detailed analysis and the accesssibilty of accurate data necessary for the integration of the manufacturing system.It may well be that, in the future, the computer may be essential to a company’s survival. Many of today’s businesses will fade away tobe replaced by more-productive combinations. Such more-productive combinations are superquality, superproductivity plants. The goal is to design and operate a plant that would produce 100% satisfactory parts with good productivity.A sophisticated, competitive world is requiring that manufacturing begin to settle for more, to become itself sophisticated. To meet competition, for example, acompany will have to meet the somewhat conflicting demands for greater product diversification, hinher quality, improved productivity, and low prices.The company that seeks to meet these demands will need a sophisticated tool, one that will allow it to respond quickly to customer needs while getting the most out of its manufacturing resources.The computer is that tool.Becoming a “superquality, superproductivity” plant requires the integration of an extremely complex system. This can be accomplished only when all elements of manufacturing-design, fabrication and assembly, quality assurance, management, materials handling-are computer integrated.In product design, for example, interactive computer-aided-design(CAD) systems allow the drawing and analysis tasks to be performed in a fraction of the time previously required and with greater accuracy. And programs for prototype testing and evaluation further speed the design process.In manufacturing planning, computer-aided process planning permits the selection, from thousands of possible sequences and schedules, of the optinun process.On the shop floor, distributed intelligence in the form of microprocessors controls machines, runs automated loading and unloading equipment, and collects data on current shop conditions.But such isolated revolutions are not enough, What is needed is a totally automated system, linked by common software from front door to back..Essentially,computer integration provides widely and instantaneously available, accurate information, improving communication between departments, permitting tighter control, and generally enhancing the overall quality and efficiency of the entire system.Improved communication can mean, for example, designs that are more producible. The NC programmer and the tool designer have a chance to influence the product designer,and vice versa.Engineering changes, thus, can be reduced, and those that are required can be handled more efficiently. Not only does the computer permit them to be specified more quickly, but it also alerts subsequent users of the data to the fact that a change has been made.The instantaneous updating of production-control data permits better planning and more-effective scheduling. Expensive equipment, therefore, is used moreproductively, and parts move more efficiently through production, reducing work-in-process costs.Product quality, too, can be improved. Not only are more-accurate designs produced, for example, but the use of design data by the quality-assurance department helps eliminate errors due to misunderstandings.People are enabled to do sheir jobs better. By eliminating tedious calculation and paperwork-not to mention time wasted searching for information-the computer mot only allows workers to be more productive but also frees them to do what only human beings can do :think creatively.Computer integration may also lure new people into manufacturing. People are attracted because they want to work in a modern, technologically sophisticated environment.In manufacturing engineering, CAD/CAM decreases tool-design, NC-programming, and planning times while speeding the response rate, which eill eventually permit in-house staff to perform work that is currently being contracted out.中文译文:计算机与制造业计算机正在将制造业带入信息时代。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

本科毕业设计(论文)外文翻译(附外文原文)系 ( 院 ):信息科学与工程学院课题名称:学生信息管理系统专业(方向):计算机科学与技术(应用)7.1 Enter ActionMappingsThe Model 2 architecture (see chapter 1) encourages us to use servlets and Java- Server Pages in the same application. Under Model 2, we start by calling a servlet.The servlet handles the business logic and directs control to the appropriate pageto complete the response.The web application deployment descriptor (web.xml) lets us map a URL patternto a servlet. This can be a general pattern, like *.do, or a specific path, like saveRecord.do.Some applications implement Model 2 by mapping a servlet to each business operation. This approach works, but many applications involve dozens or hundredsof business operations. Since servlets are multithreaded, instantiating so manyservlets is not the best use of server resources. Servlets are designed to handle anynumber of parallel requests. There is no performance benefit in simply creatingmore and more servlets.The servlet’s primary job is to interact with the container and HTTP. Handlinga business operation is something that a servlet could delegate to another component. Struts does this by having the ActionServlet delegate the business operationto an object. Using a servlet to receive a request and route it to a handler is knownas the Front Controller pattern [Go3].Of course, simply delegating the business operation to another componentdoes not solve the problem of mapping URIs [W3C, URI] to business operations.Our only way of communicating with a web browser is through HTTP requests and URIs. Arranging for a URI to trigger a business operation is an essential part of developing a web application.Meanwhile, in practice many business operations are handled in similar ways.Since Java is multithreaded, we could get better use of our server resources if wecould use the same Action object to handle similar operations. But for this towork, we might need to pass the object a set of configuration parameters to usewith each operation.So what’s the bottom line? To implement Model 2 in an efficient and flexibleway, we need to:Enter ActionMappings 195_ Route requests for our business operations to a single servlet_ Determine which business operation is related to the request_ Load a multithreaded helper object to handle the business operation_ Pass the helper object the specifics of each request along with any configurationdetail used by this operationThis is where ActionMappings come in.7.1.1 The ActionMapping beanAn ActionMapping (org.apache.struts.action.ActionMapping) describes howthe framework handles each discrete business operation (or action). In Struts,each ActionMapping is associated with a specific URI through its path property. When a request comes in, the ActionServlet uses the path property to select the corresponding ActionMapping. The set of ActionMapping objects is kept in an ActionMappings collection (org.apache.struts.action.ActionMappings). Originally, the ActionMapping object was used to extend the Action objectrather than the Action class. When used with an Action, a mapping gives a specific Action object additional responsibilities and new functionality. So, it was essentiallyan Action decorator [Go4]. Along the way, the ActionMapping evolved into anobject in its own right and can be used with or without an Action.DEFINITION The intent of the decorator pattern is to attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassingfor extending functionality [Go4].The ActionMappings are usually created through the Struts configuration file.For more about this file, see chapter 4.7.1.2 The ActionMappings catalogThe ActionMappings catalog the business logic available to a Struts application.When a request comes in, the servlet finds its entry in the ActionMappings catalogand pulls the corresponding bean.The ActionServlet uses the ActionMapping bean to decide what to do next. Itmay need to forward control off to another resource. Or it may need to populateand validate an ActionForm bean. At some point, it may have to pass control to an Action object, and when the Action returns, it may have to look up an Action-Forward associated with this mapping.196 CHAPTER 7Designing with ActionMappingsThe ActionMapping works like a routing slip for the servlet. Depending onhow the mapping is filled out, the request could go just about anywhere.The ActionMappings represent the core design of a Struts application. If youwant to figure out how a Struts application works, start with the ActionMappings. Ifyou want to figure out how to write a new Struts application, start with the Action- Mappings. The mappings are at the absolute center of every Struts application.In this chapter, we take a close look at the ActionMapping properties andexplore how they help you design the flow of a Struts application.1.0 vs 1.1 In Struts 1.1, ActionMapping subclasses ActionConfig (org.apache. struts.config.ActionConfig) and adds API methods required forbackward compatibility. ActionMapping is not deprecated, and how thehierarchy will be handled in future releases has not been determined.For now, we refer to the ActionMapping class, but you should note thatin Struts 1.1 all of the action properties are actually defined by the ActionConfigsuper class. The ActionMapping class otherwise works thesame way in both versions.7.2 ActionMapping propertiesTable 7.1 describes the base ActionMapping properties. As with other configuration components, developers may extend ActionMapping to provide additionalproperties.Table 7.1 The base ActionMapping propertiesProperty Descriptionpath The URI path from the request used to select this mapping. (API command) forward The context-relative path of the resource that should serve this request via a forward.Exactly one of the forward, include, or type properties must be specified.orinclude The context-relative path of the resource that should serve this request via aninclude. Exactly one of the forward, include, or type properties must be specified.ortype Optionally specifies a subclass oforg.apache.struts.action.ActionMappingthat should be used when instantiating this mapping.className The fully qualified name of the Action class used by this mapping. SinceStruts 1.1ActionMapping properties 197In the sections that follow, we take a look at each of these properties.7.2.1 The path propertyThe ActionMapping URI, or path, will look to the user like just another file onthe web server. But it does not represent a file. It is a virtual reference to our ActionMapping.Because it is exposed to other systems, the path is not really a logical name, likethose we use with ActionForward. The path can include slashes and an extension—as if it referred to a file system—but they are all just part of a single name.The ActionMappings themselves are a “flat” namespace with no type of internalhierarchy whatsoever. They just happen to use the same characters that we areused to seeing in hierarchical file systems.name The name of the form bean, if any, associated with this action. This is not the classname. It is the logical name used in the form bean configuration.roles The list of security roles that may access this mapping.scope The identifier of the scope (request or session) within which the form bean, if any,associated with this mapping will be created.validate Set to true if the validate method of the form bean (if any) associated with thismapping should be called.input Context-relative path of the input form to which control should be returned ifa validationerror is encountered. This can be any URI: HTML, JSP, VM, or another Action- Mapping.parameter General-purpose configuration parameter that can be used to pass extra informationto the Action selected by this ActionMapping.attribute Name of the request-scope or session-scope attribute under which our form bean isaccessed, if it is other than the bean's specified name.prefix Prefix used to match request parameter names to form bean property names, if any.suffix Suffix used to match request parameter names when populating the properties ofour ActionForm bean, if any.unknown Can be set to true if this mapping should be configured as the default for this application(to handle all requests not handled by another mapping). Only one mappingcan be defined as the default unknown mapping within an application.forwards(s) Block of ActionForwards for this mapping to use, if any.exception(s) Block of ExceptionHandlers for this mapping to use, if any.Table 7.1 The base ActionMapping properties (continued)Property DescriptionSinceStruts 1.1SinceStruts 1.1198 CHAPTER 7Designing with ActionMappingsOf course, it can still be useful to treat your ActionMappings as if they werepart of a hierarchy and group related commands under the same "folder." Theonly restriction is that the names must match whatever pattern is used in the application’s deployment description (web.xml) for the ActionServlet. This is usuallyeither /do/* or *.do, but any similar pattern can be used.If you are working in a team environment, different team members can begiven different ActionMapping namespaces to use. Some people may be workingwith the /customer ActionMappings, others may be working with the /vendor ActionMappings. This may also relate to the Java package hierarchy the team isusing. Since the ActionMapping URIs are logical constructs, they can be organizedin any way that suits your project.With Struts 1.1, these types of namespaces can be promoted to applicationmodules. Each team can work independently on its own module, with its own setof configuration files and presentation pages. Configuring your application to use multiple modules is covered in chapter 4.DEFINITION The web runs on URIs, and most URIs map to physical files. If you want to change the resource, you change the corresponding file. Some URIs, likeStruts actions, are virtual references. They do not have a correspondingfile but are handled by a programming component. To change the resource,we change how the component is programmed. But since thepath is a URI and interacts with other systems outside our control, thepath is not a true logical reference—the name of an ActionForward, forinstance. We can change the name of an ActionForward without consultingother systems. It’s an internal, logical reference. If we change thepath to an ActionMapping, we might need to update other systems thatrefer to the ActionMapping through its public URI.7.2.2 The forward propertyWhen the forward property is specified, the servlet will not pass the request to an Action class but will make a call to RequestDispatcher.forward. Since the operationdoes not use an Action class, it can be used to integrate Struts with otherresources and to prototype systems. The forward, include, and type propertiesare mutually exclusive. (See chapter 6 for more information.)7.2.3 The include propertyWhen the include property is specified, the servlet will not pass the request to an Action class but will make a call to RequestDispatcher.include. The operationActionMapping properties 199does not use an Action class and can be used to integrate Struts with other components. The forward, include, and type properties are mutually exclusive. (Seechapter 6 for more information.)7.2.4 The type propertyMost mappings will specify an Action class type rather than a forward or include.An Action class may be used by more than one mapping. The mappings may specifyform beans, parameters, forwards, or exceptions. The forward, include, andtype properties are mutually exclusive.7.2.5 The className propertyWhen specified, className is the fully qualified Java classname of the ActionMapping subclass that should be used for this object. This allows you to use your own ActionMapping subclass with specialized methods and properties. See alsosection 7.4.7.2.6 The name propertyThis property specifies the logical name for the form bean, as given in the formbean segment of the Struts configuration file. By default, this is also the name tobe used when placing the form bean in the request or session context. Use theattribute property of this class to specify a different attribute key.7.2.7 The roles propertyThis property is a comma-delimited list of the security role names that are allowed access to this ActionMapping object. By default, the same system that is used with standard container-based security is applied to the list of roles given here. Thismeans you can use action-based security in lieu of specifying URL patterns in the deployment descriptor, or you can use both together.The security check is handled by the processRoles method of the Request- Processor (org.apache.struts.action.RequestProcessor). By subclassing RequestProcessor, you can also use the roles property with application-based security. See chapter 9 for more about subclassing RequestProcessor.7.2.8 The scope propertyThe ActionForm bean can be stored in the current request or in the session scope (where it will be available to additional requests). While most developers userequest scope for the ActionForm, the framework default is session scope. Tomake request the default, see section 7.4.SinceStruts 1.1SinceStruts 1.1200 CHAPTER 7Designing with ActionMappings7.2.9 The validate propertyAn important step in the lifecycle of an ActionForm is to validate its data before offering it to the business layer. When the validate property for a mapping is true, the ActionServlet will call the ActionForm’s validate method. If validate returns false, the request is forwarded to the resource given by the input property.Often, developers will create a pair of mappings for each data entry form. Onemapping will have validate set to false, so you can create an empty form. Theother has validate set to true and is used to submit the completed form.NOTE Whether or not the ActionForm validate method is called does not relateto the ActionServlet’s validating property. That switch controlshow the Struts configuration file is processed.7.2.10 The input propertyWhen validate is set to true, it is important that a valid path for input be provided. This is where control will pass should the ActionForm validate methodreturn false. Often, this is the address for a presentation page. Sometimes it willbe another Action path (with validate set to false) that is required to generatedata objects needed by the page.NOTE The input path often leads back to the page that submitted the request.While it seems natural for the framework to return the request to whereit originated, this is not a simple task in a web application. A request is oftenpassed from component to component before a response is sent backto the browser. The browser only knows the path it used to retrieve theinput page, which may or may not also be the correct path to use for theinput property. While it may be possible to try and generate a default inputpage based on the HTTP referrer attribute, the Struts designersdeemed that approach unreliable.inputForwardIn Struts 1.0, the ActionMapping input property is always a literal URI. InStruts 1.1, it may optionally be the name of an ActionForward instead. The ActionForward is retrieved and its path property is used as the input property.This can be a global or local ActionForward.To use ActionForwards here instead of literal paths, set the inputForwardattribute on the <controller> element for this module to true:SinceStruts 1.1ActionMapping properties 201<controller inputForward="true">For more about configuring Struts, see chapter 4. For more about ActionForwards,see chapter 6.7.2.11 The parameter propertyThe generic parameter property allows Actions to be configured at runtime. Severalof the standard Struts Actions make use of this property, and the standardScaffold Actions often use it, too. The parameter property may contain a URI, the name of a method, the name of a class, or any other bit of information an Actionmay need at runtime. This flexibility allows some Actions to do double and tripleduty, slashing the number of distinct Action classes an application needs on hand.Within an Action class, the parameter property is retrieved from the mappingpassed to perform:parameter = mapping.getParameter();Multiple parametersWhile multiple parameters are not supported by the standard ActionMappingsclass, there are some easy ways to implement this, including using HttpUtils, a StringTokenizer, or a Properties file (java.util.Properties).HttpUtils. Although deprecated as of the Servlet API 2.3 specification, theHttpUtils package (javax.servlet.http.HttpUtils) provides a static method that parses any string as if it were a query string and returns a Hashtable(java.util.Hashtable):Hashtable parameters = parseQueryString(parameter);The parameter property for your mapping then becomes just another query string, because you might use it elsewhere in the Struts configuration. stringTokenizer. Another simple approach is to delimit the parameters using the token of your choice—such as a comma, colon, or semicolon—and use the StringTokenizer to read them back:StringTokenizer incoming =new StringTokenizer(mapping.getParameter(),";");int i = 0;String[] parameters = new String[incoming.countTokens()]; while (incoming.hasMoreTokens()) {parameters[i++] = incoming.nextToken().trim();}202 CHAPTER 7Designing with ActionMappingsProperties file. While slightly more complicated than the others, another popular approach to providing multiple parameters to an ActionMapping is with a standard Properties files (java.util.Properties). Depending on your needs, the Properties file could be stored in an absolute location in your file system or anywhere on your application’s CLASSPATH.The Commons Scaffold package [ASF, Commons] provides a ResourceUtils package (mons.scaffold.util.ResourceUtils) with methods forloading a Properties file from an absolute location or from your application’s CLASSPATH.7.2.12 The attribute propertyFrom time to time, you may need to store two copies of the same ActionForm inthe same context at the same time. This most often happens when ActionFormsare being stored in the session context as part of a workflow. To keep their names from conflicting, you can use the attribute property to give one ActionForm bean a different name.An alternative approach is to define another ActionForm bean in the configuration, using the same type but under a different name.7.2.13 The prefix and suffix propertiesLike attribute, the prefix and suffix properties can be used to help avoid naming conflicts in your application. When specified, these switches enable aprefix or suffix for the property name, forming an alias when it is populatedfrom the request.If the prefix this was specified, thenthisName=McClanahanbecomes equivalent toname=McClanahanfor the purpose of populating the ActionForm. Either or both parameters would call getName("McClanahan");This does not affect how the properties are written by the tag extensions. It affects how the autopopulation mechanism perceives them in the request.Nested components 2037.2.14 The unknown ActionMappingWhile surfing the Web, most of us have encountered the dreaded 404— page not found message. Most web servers provide some special features for processing requests for unknown pages, so webmasters can steer users in the right direction. Struts offers a similar service for ActionMapping 404s—the unknown ActionMapping. In the Struts configuration file, you can specify one ActionMapping toreceive any requests for an ActionMapping that would not otherwise be matched:<actionname="/debug"forward="/pages/debug.jsp"/>When this option is not set, a request for an ActionMapping that cannot bematched throws400 Invalid path /notHere was requestedNote that by a request for an ActionMapping, we mean a URI that matches the prefix or suffix specified for the servlet (usually /do/* or *.do). Requests for other URI patterns, good or bad, will be handled by other servlets or by the container:/do/notHere (goes to the unknown ActionMapping)/notHere.txt (goes to the container)7.3 Nested componentsThe ActionMapping properties are helpful when it comes to getting an Action torun a business operation. But they tell only part of the story. There is still much todo when the Action returns.An Action may have more than one outcome. We may need to register several ActionForwards so that the Action can take its pick.7.3.1 Local forwardsIn the normal course, an ActionMapping is used to select an Action object to handle the request. The Action returns an ActionForward that indicates which pageshould complete the response.The reason we use ActionForwards is that, in practice, presentation pages areeither often reused or often changed, or both. In either case, it is good practice to encapsulate the page’s location behind a logical name, like “success” or “failure.”The ActionForward object lets us assign a logical name to any given URI.204 CHAPTER 7Designing with ActionMappingsOf course, logical concepts like success or failure are often relative. What represents success to one Action may represent failure to another. Each Action-Mapping can have its own set of local ActionForwards. When the Action asks for a forward (by name), the local set is checked before trying the global forwards. See chapter 6 for more about ActionForwards.Local forwards are usually specified in the Struts configuration file. See chapter4 for details.7.3.2 Local exceptionsMost often, an application’s exception handlers (org.apache.struts.action. ExceptionHandler) can be declared globally. However, if a given ActionMapping needs to handle an exception differently, it can have its own set of local exception handlers that are checked before the global set.Local exceptions are usually specified in the Struts configuration file. Seechapter 4 for details.7.4 Rolling your own ActionMappingWhile ActionMapping provides an impressive array of properties, developers may also provide their own subclass with additional properties or methods. InStruts 1.0, this is configured in the deployment descriptor (web.xml) for the ActionServlet:<init-param><param-name>mapping</param-name><param-value>app.MyActionMapping</param-value></init-param>In Struts 1.1, this is configured in the Struts configuration file as an attribute to the <action-mappings> element:<action-mappings type="app.MyActionMapping">Individual mappings may also be set to use another type through the className attribute:<action className="app.MyActionMapping">For more about configuring Struts, see chapter 4.SinceStruts 1.1Summary 205The framework provides two base ActionMapping classes, shown in table 7.2. They can be selected as the default or used as a base for your own subclasses.The framework default is SessionActionMapping, so scope defaults to session. Subclasses that provide new properties may set them in the Struts configuration using a standard mechanism:<set-property property="myProperty" value="myValue" /> Using this standard mechanism helps developers avoid subclassing the Action- Servlet just to recognize the new properties when it digests the configuration file. This is actually a feature of the Digester that Struts simply inherits.7.5 SummarySun’s Model 2 architecture teaches that servlets and JavaServer Pages should be used together in the same application. The servlets can handle flow control and data acquisition, and the JavaServer Pages can handle the HTML.Struts takes this one step further and delegates much of the flow control anddata acquisition to Action objects. The application then needs only a single servletto act as a traffic cop. All the real work is parceled out to the Actions and theStruts configuration objects.Like servlets, Actions are efficient, multithreaded singletons. A single Actionobject can be handling any number of requests at the same time, optimizing your server’s resources.To get the most use out of your Actions, the ActionMapping object is used as a decorator for the Action object. It gives the Action a URI, or several URIs, and away to pass different configuration settings to an Action depending on which URIis called.In this chapter, we took a close look at the ActionMapping properties andexplained each property’s role in the scheme of things. We also looked at extendingthe standard ActionMapping object with custom properties—just in case yourscheme needs even more things.Table 7.2 The default ActionMapping classesActionMapping Descriptionorg.apache.struts.action.SessionActionMapping Defaults the scope property to sessionorg.apache.struts.action.RequestActionMapping Defaults the scope property to request206 CHAPTER 7Designing with ActionMappingsIn chapter 8, the real fun begins. The configuration objects covered so far aremainly a support system. They help the controller match an incoming requestwith a server-side operation. Now that we have the supporting players, let’s meet the Struts diva: the Action object.7.1 进入ActionMappingModel 2 架构(第1章)鼓励在同一个应用中使用servlet和JSP页面。

相关文档
最新文档