As web applications have become more complex, they have begun to push the boundaries of both the capabilities of the browser and the usability of the application. As their popu- larity grows, these issues become more apparent and impor- tant and highlight the fact that there are still a number of significant issues for both developers and end users when deploying and using applications within the browser. The web browser was originally designed to deliver and dis- play HTML-based documents. Indeed, the basic design of the browser has not significantly shifted from this purpose. This fundamental conflict between document- and applica- tion-focused functionality creates a number of problems when deploying applications via the browser.
In a development highly offensive to humans’ pride, it seems that we too can be duped by dragonflies and hoverflies: this is con- firmed by experimental studies  and resolves the mystery of dragonfly flight which puzzled me when I was a child. When you see a dragonfly over a river or meadow, it frequently appears to be hanging in the air motionless, as if it were glued to the sky, and then suddenly jumps at you, whizzing by a few inches from your face—you feel on your skin the air stream from its wings. Only upon reading Glendinning’s paper did I realize that the dragonfly was not motionless—it was approaching me on a reconnaissance flight. If you consider for a second how such an astonishing defeat in a mathematical game against insects could ever happen, it be- comes apparent that, although human vision is exceptionally good at detecting even the tiniest relative changes in the position of an object, we are not good at detecting gradual increases in the rela- tive size of an object. (David Broomhead suggests that this can be explained by the structure of light receptors in our eyes’ retina.) You would probably agree with me if you have ever looked at a distant approaching train, seen as a spot of light at the vanishing point of the rail tracks. It is very hard to judge whether the train is stationary or is approaching the platform. It is even harder in modern Britain, where it has become a non-trivial proposition.
One way to understand what’s going on here is through the concept of a closure, a technique for implementing higher-order functions. When a function expression is evaluated, a copy of the environment is attached to the function. Subsequently, all free variables of the function (i.e., those variables not occurring as parameters) are resolved with respect to the en- vironment attached to the function; the function is therefore said to be “closed” with respect to the attached environment. This is achieved at function application time by “swapping” the attached environment of the function for the environment active at the point of the call. The swapped environment is restored after the call is complete. Returning to the ex- ample above, the environment associated with the function f contains the declaration val x = 2 to record the fact that at the time the function was evaluated, the variable x was bound to the value 2. The variable x is sub- sequently re-bound to 3, but when f is applied, we temporarily reinstate the binding of x to 2, add a binding of y to 4, then evaluate the body of the function, yielding 6. We then restore the binding of x and drop the binding of y before yielding the result.
To a request for a third solution the system will reply no (no more large countries). To write or understand Prolog programs, one has to think not only about their meaning as specifications, but also about Prolog’s search strategy. In that sense, Prolog is not fully declarative; it has an “operational semantics.” Answer set programming (ASP)—the form of logic programming described in this book—is closer to the ideal of declarativism. ASP became possible after the invention of the concept of a stable model and the creation of software systems that generate stable models. These systems are called answer set solvers, and their operation is described in many articles, dissertations, and books. But if your goal is to use answer set solvers, rather than design a new system of this kind, then you do not need to know much about how they operate. This book, in fact, will tell you almost nothing about what happens “under the hood.” (Section 3.4 and a passage in Section 2.8 are the only places where the operation of an answer set solver is discussed in any detail.) Answer set programming has no operational semantics.
A very important but often overlooked aspect of debugging is keeping track of the information pertaining to identified bugs. A game development team might easily receive hundreds of bug reports during the course of a game’s development and beta test, and it is essential to organize these reports so that the developers can easily verify and resolve the bugs. Bug-tracking software is every bit as important to a serious game development operation as the debugger itself. The Mozilla project’s Bugzilla has emerged as one of the best and most widely used bug-tracking systems. Bugzilla is a Web-based system written in Perl and designed for use with the popular Apache Web server and MySQL database server. With it, users can report bugs, check to see if a reported bug has been resolved, and browse through other bugs that have been reported. Bugzilla is covered under the Mozilla Public License, and it can be freely used and modified. It is relatively simple to install if MySQL and Apache are already configured. To see Bugzilla in action, visit http://bugzilla.mozilla.org.
This textbook has had an interesting evolutionary history that in some ways mirrors the genesis of the C++ language itself. Just as Bjarne Stroustrup’s first version of C++ was implemented on top of a C language base, this reader began its life as my textbook Programming Abstractions in C (Addison-Wesley, 1998). In 2002-03, Julie Zelenski updated it for use with the C++ programming language, which we began using in CS106 B and CS106 X during that year. Although the revised text worked fairly well at the outset, CS106 B and CS106 X have evolved in recent years so that their structure no longer tracks the organization of the book. In 2009, I embarked on a comprehensive process of rewriting the book so that students in these courses can use it as both a tutorial and a reference. As always, that process takes a considerable amount of time, and there are almost certainly some sections of the book that need a substantial rewrite.
Under Linux, device drivers are part of the kernel and may be either linked stati- cally into the kernel or loaded on demand as kernel modules. Device drivers run as part of the kernel and aren’t directly accessible to user processes. However, Linux pro- vides a mechanism by which processes can communicate with a device driver—and through it with a hardware device—via file-like objects.These objects appear in the file system, and programs can open them, read from them, and write to them practi- cally as if they were normal files. Using either Linux’s low-level I/O operations (see Appendix B, “Low-Level I/O”) or the standard C library’s I/O operations, your pro- grams can communicate with hardware devices through these file-like objects.
Prolog is considered diﬃcult by students. Usually, by the time they learn Prolog, which is most likely to happen in preparation for a course in Artiﬁcial Intelligence (AI) or Expert Systems, they will have studied imperative programming and/or the object oriented paradigm. Unfortunately, this prior experience is not always conducive to learning Prolog. Even though there is a good provision of traditional Prolog textbooks (for example ), students still ﬁnd it hard to write solutions in Prolog to problems of any notable complexity. In my experience this holds also (and in particular) for problems for which Prolog should be the natural choice.
In our work with the county data, I said that setting up two arrays, one for the county names and one for their populations, was not the ideal approach. The trouble is that there is nothing but numerical position in the respective sequences to tie individual population figures to the correct names. This is risky. Code- chunk (13), which set the arrays up, will never put a population figure in a wrong cell, differently- numbered from the cell containing the corresponding name; but, in real-life programming, data sets often have to be changed and updated after they are initially created, and we have set up a system here where it would be all too easy for the @countyNames and @countyPops arrays to get out of synch with one another. It shouldn’t happen – but, with software, if something can go wrong then sooner or later it probably will.
The Help files provide a lot of information, both for beginner and expert programmers, and they are especially valuable as a reference tool. They list all of the methods and properties for each component, the parameters of each method or function, and similar details, which are particularly important while you are writing code. Borland also distributes reference materials in the form of Adobe Acrobat files. These are electronic versions of the printed manuals that come in the Delphi box, so you can search them for a word, and you can also print the portions you are interested in (or even the whole file if you’ve got some spare paper).
The research program of eliminating nonparametric variation from syntax is common to many theories, including some of the most pure combinatorical theo- ries, such as classical transformational grammar and modern minimalist syntax. The standard form (see Chomsky and Lasnik 1993) is often called principles and param- eters theory, assuming a common core of grammatical principles that operate in all languages, and a finite set of binary parameters that govern them (so that altogether there are only finitely many core systems). This is an extremely attractive model, but one that faces many serious technical difficulties that come to light as soon as we at- tempt to flesh out the typological system. First of all, there are many languages that are split (display a mixture of the pure types). For instance, German, while widely regarded as an SOV or V2 (verb second) language, displays a pure SVO construction and has several different word orders both in main and in subordinate clauses. Tradi- tional descriptions of German word order, such as Drach (1937), therefore employ a linear structure composed of separate structural positions or topological fields, a no- tion that has little typological generality. Even if we could separate out the parochial from the universal factors in such cases, there is a larger problem: the terms that we use in establishing our typology may have no traction over the actual variety of languages.
The theory of sets, initiated by Georg Cantor (1845–1918), constitutes the basis of almost all modern mathematics. The set concept itself cannot be defined in simpler terms. A set is often described as a collection (“aggregate”, “class”, “totality”, “family”) of objects of any specified kind. However, such descriptions are no definitions, as they merely replace the term “set” by other undefined terms. Thus the term “set” must be accepted as a primitive notion , without definition. Examples of sets are as follows: the set of all men; the set of all letters appearing on this page; the set of all straight lines in a given plane; the set of all positive integers; the set of all English songs; the set of all books in a library; the set consisting of the three numbers 1, 4, 17. Sets will usually be denoted by capital letters, A, B, C, . . . , X, Y , Z .
This hack has proved useful to myself in a number of occasions. The first was a file system problem. It seemed that when the computer was shutdown and there were files being written to the disk, the operating system would pad the unwritten sectors with blocks containing all zeros. Fortunately the magic numbers were there and the program realized that it had read something that was half a good record and half something else and discarded the data.
It has been observed that mathematics is the most abstract of the sciences, music the most abstract of the arts. Mathematics attempts to understand conceptual and logical truth and appreciates the intrinsic beauty of such. Music evokes mood and emotion by the audio medium of tones and rhythms without appealing to circumstantial means of eliciting such innate human re- actions. Therefore it is not surprising that the symbiosis of the two disciplines is an age old story. The Greek mathematician Pythagoras noted the integral relationships between frequencies of musical tones in a consonant interval; the 18th century musician J. S. Bach studied the mathematical problem of finding a practical way to tune keyboard instruments. In today’s world it is not at all unusual to encounter individuals who have at least some interest in both subjects.
Before proceeding with this tutorial you should have a basic understanding of software basic concepts like what is source code, compiler, text editor, and execution of programs, etc. If you already have understanding on any other computerprogramming language, then it will be an added advantage to proceed.