1、java外文翻译教学内容(3) 心态问题(二)上海的人口环境对饰品消费的影响根本不知道我们女生之所以会钟爱饰品,也许是因为它的新颖,可爱,实惠,时尚,简单等。的确,手工艺品价格适中。也许还有更多理由和意义。那么大学生最喜欢哪种手工艺品呢?此次调查统计如下图(1-3)1 www。cer。net/artide/2004021313098897。shtml。(三)大学生购买消费DIY手工艺品的特点分析在上海, 随着轨道交通的发展,地铁商铺应运而生,并且在重要商圈已经形成一定的气候,投资经营地铁商铺逐渐为一大热门。在人民广场地下的迪美购物中心,有一家DIY自制饰品店-“碧芝自制饰品店”喜欢 一般 不喜
2、欢根本不知道400-500元 13 26%毕业设计外文资料翻译(译文)题目名称: Java and the Internet 学 院: 计算机科学技术 专业年级: 计算机科学与技术(师)08 级 学生姓名: aaa 班级学号: a班a号 指导教师: aaa 二一一 年 五 月 十三 日译文题目: Java和因特网 原文题目: Java and the Internet 原文出处: Java and the InternetIf Java is, in fact, yet another computer programming language, you may question why it
3、 is so important and why it is being promoted as a revolutionary step in computer programming. The answer isnt immediately obvious if youre coming from a traditional programming perspective. Although Java is very useful for solving traditional stand-alone programming problems, it is also important b
4、ecause it will solve programming problems on the World Wide Web.1. Client-side programmingThe Webs initial server-browser design provided for interactive content, but the interactivity was completely provided by the server. The server produced static pages for the client browser, which would simply
5、interpret and display them. Basic HTML contains simple mechanisms for data gathering: text-entry boxes, check boxes, radio boxes, lists and drop-down lists, as well as a button that can only be programmed to reset the data on the form or “submit” the data on the form back to the server. This submiss
6、ion passes through the Common Gateway Interface (CGI) provided on all Web servers. The text within the submission tells CGI what to do with it. The most common action is to run a program located on the server in a directory thats typically called “cgi-bin.” (If you watch the address window at the to
7、p of your browser when you push a button on a Web page, you can sometimes see “cgi-bin” within all the gobbledygook there.) These programs can be written in most languages. Perl is a common choice because it is designed for text manipulation and is interpreted, so it can be installed on any server r
8、egardless of processor or operating system.Many powerful Web sites today are built strictly on CGI, and you can in fact do nearly anything with it. However, Web sites built on CGI programs can rapidly become overly complicated to maintain, and there is also the problem of response time. The response
9、 of a CGI program depends on how much data must be sent, as well as the load on both the server and the Internet. (On top of this, starting a CGI program tends to be slow.) The initial designers of the Web did not foresee how rapidly this bandwidth would be exhausted for the kinds of applications pe
10、ople developed. For example, any sort of dynamic graphing is nearly impossible to perform with consistency because a GIF file must be created and moved from the server to the client for each version of the graph. And youve no doubt had direct experience with something as simple as validating the dat
11、a on an input form. You press the submit button on a page; the data is shipped back to the server; the server starts a CGI program that discovers an error, formats an HTML page informing you of the error, and then sends the page back to you; you must then back up a page and try again. Not only is th
12、is slow, its inelegant.The solution is client-side programming. Most machines that run Web browsers are powerful engines capable of doing vast work, and with the original static HTML approach they are sitting there, just idly waiting for the server to dish up the next page. Client-side programming m
13、eans that the Web browser is harnessed to do whatever work it can, and the result for the user is a much speedier and more interactive experience at your Web site.The problem with discussions of client-side programming is that they arent very different from discussions of programming in general. The
14、 parameters are almost the same, but the platform is different: a Web browser is like a limited operating system. In the end, you must still program, and this accounts for the dizzying array of problems and solutions produced by client-side programming. The rest of this section provides an overview
15、of the issues and approaches in client-side programming.2.Plug-insOne of the most significant steps forward in client-side programming is the development of the plug-in. This is a way for a programmer to add new functionality to the browser by downloading a piece of code that plugs itself into the a
16、ppropriate spot in the browser. It tells the browser “from now on you can perform this new activity.” (You need to download the plug-in only once.) Some fast and powerful behavior is added to browsers via plug-ins, but writing a plug-in is not a trivial task, and isnt something youd want to do as pa
17、rt of the process of building a particular site. The value of the plug-in for client-side programming is that it allows an expert programmer to develop a new language and add that language to a browser without the permission of the browser manufacturer. Thus, plug-ins provide a “back door” that allo
18、ws the creation of new client-side programming languages (although not all languages are implemented as plug-ins).3.Scripting languagesPlug-ins resulted in an explosion of scripting languages. With a scripting language you embed the source code for your client-side program directly into the HTML pag
19、e, and the plug-in that interprets that language is automatically activated while the HTML page is being displayed. Scripting languages tend to be reasonably easy to understand and, because they are simply text that is part of an HTML page, they load very quickly as part of the single server hit req
20、uired to procure that page. The trade-off is that your code is exposed for everyone to see (and steal). Generally, however, you arent doing amazingly sophisticated things with scripting languages so this is not too much of a hardship.This points out that the scripting languages used inside Web brows
21、ers are really intended to solve specific types of problems, primarily the creation of richer and more interactive graphical user interfaces (GUIs). However, a scripting language might solve 80 percent of the problems encountered in client-side programming. Your problems might very well fit complete
22、ly within that 80 percent, and since scripting languages can allow easier and faster development, you should probably consider a scripting language before looking at a more involved solution such as Java or ActiveX programming.The most commonly discussed browser scripting languages are JavaScript (w
23、hich has nothing to do with Java; its named that way just to grab some of Javas marketing momentum), VBScript (which looks like Visual Basic), and Tcl/Tk, which comes from the popular cross-platform GUI-building language. There are others out there, and no doubt more in development.JavaScript is pro
24、bably the most commonly supported. It comes built into both Netscape Navigator and the Microsoft Internet Explorer (IE). In addition, there are probably more JavaScript books available than there are for the other browser languages, and some tools automatically create pages using JavaScript. However
25、, if youre already fluent in Visual Basic or Tcl/Tk, youll be more productive using those scripting languages rather than learning a new one. (Youll have your hands full dealing with the Web issues already.) 4.JavaIf a scripting language can solve 80 percent of the client-side programming problems,
26、what about the other 20 percentthe “really hard stuff?” The most popular solution today is Java. Not only is it a powerful programming language built to be secure, cross-platform, and international, but Java is being continually extended to provide language features and libraries that elegantly hand
27、le problems that are difficult in traditional programming languages, such as multithreading, database access, network programming, and distributed computing. Java allows client-side programming via the applet.An applet is a mini-program that will run only under a Web browser. The applet is downloade
28、d automatically as part of a Web page (just as, for example, a graphic is automatically downloaded). When the applet is activated it executes a program. This is part of its beautyit provides you with a way to automatically distribute the client software from the server at the time the user needs the
29、 client software, and no sooner. The user gets the latest version of the client software without fail and without difficult reinstallation. Because of the way Java is designed, the programmer needs to create only a single program, and that program automatically works with all computers that have bro
30、wsers with built-in Java interpreters. (This safely includes the vast majority of machines.) Since Java is a full-fledged programming language, you can do as much work as possible on the client before and after making requests of the server. For example, you wont need to send a request form across t
31、he Internet to discover that youve gotten a date or some other parameter wrong, and your client computer can quickly do the work of plotting data instead of waiting for the server to make a plot and ship a graphic image back to you. Not only do you get the immediate win of speed and responsiveness,
32、but the general network traffic and load on servers can be reduced, preventing the entire Internet from slowing down.One advantage a Java applet has over a scripted program is that its in compiled form, so the source code isnt available to the client. On the other hand, a Java applet can be decompiled without too much trouble, but hiding your code is often not an important issue. Two other factors can be important. As you will see later in this book, a compiled Java applet can comprise many modules and take multiple serve