How to be a Programmer
Martin L. Smith writes "Rob Read has posted his magnum opus, "How to be a Programmer: A Short, Comprehensive and Personal Summary" to Samizdat Press where it can be scarfed by the masses. Rob's book is a forty-page tour through the million-and-one things he thinks a programmer ought to know as he sets out into deep water. One of the reasons he posted this was to get some feedback, so tell him what you think. Samizdat Press is maintained by the Colorado School of Mines to provide a distribution point for free (mostly earth-sciences related) texts."
BITS is a cool new file transfer feature of Windows that asynchronously downloads files from a remote server over HTTP. BITS can manage multiple downloads from multiple users while making use of idle bandwidth exclusively. Although the use of BITS is not limited to auto-updating applications, it is the underlying API used by Windows Update. And since it is available to any application, it can be used to do much of the really tough work involved in creating an auto-updating application. .NET Server. In addition to the features contained in BITS 1.0, version 1.5 has interruptible background uploading of files and authenticated connections using Basic, Digest, NTLM, Negotiate (Kerberos) or Passport. BITS 1.5 is available as a redistributable that is compatible with Windows 2000 and greater (see Background Intelligent Transfer Service).
Here is the basic idea. An application asks BITS to manage the download of a file or set of files. BITS adds the job to its queue and associates the job with the user context under which the application is running. As long as the user is logged on, BITS will drizzle the files across the network using idle bandwidth. In fact, the code-name for the BITS technology is Drizzle, which, it turns out, is quite descriptive of what BITS does.
How does all of this work? The technology is actually fairly sophisticated. First, BITS is implemented as a Windows service that maintains a collection of jobs organized into a set of priority queues: foreground, high, normal, and low. Each job in the same priority level is given bandwidth via time slices of about five minutes, in a round-robin fashion. Once there are no jobs remaining in a queue, the next priority queue is inspected for jobs.
Jobs in the foreground queue use as much network bandwidth as they can, and for this reason the foreground priority should only be used by code that is responding to a user request. The remaining priorities--high, normal, and low--are much more interesting because they are all background priorities, which is to say that they only make use of network bandwidth that's not in use.
To achieve this background feature, BITS monitors network packets and disregards packets that it recognizes as its own. The remaining packets are considered the active load on the machine's bandwidth. BITS uses the active load information along with the connection speed and some other statistics to decide whether it should continue downloading files or back off in order to increase throughput for the active user. Because of this, the user doesn't experience bandwidth problems.
The ability to drop what it is doing at a moment's notice is very important for BITS. In many cases, only part of a file is downloaded before BITS must give up the network or even lose connection altogether. The partially downloaded file is saved, however, and when BITS gets another crack at the network, it picks up where it left off. This ability to recover does have some side effects.
Remember that BITS is used to transfer files from HTTP servers. A server should be HTTP 1.1-compliant or at least support the Range header in the GET method for BITS to work. This is because BITS needs to be able to request a portion of a file. In addition, the content being downloaded must be static content such as a markup file, code file, bitmap, or sound. A GET request including a Range header makes no sense when requesting dynamic content such as that produced by CGI, ISAPI, or ASP.NET.
Currently, there are two versions of BITS: 1.0 and 1.5. BITS 1.0 ships with Windows XP and has the following features: interruptible background downloading of files, download prioritization, optional notification of completed jobs and error situations, and optional progress notifications for use with dialog boxes and other UI elements. BITS 1.5 ships with Windows
The BITS 1.0 feature set is sufficient for writing auto-updating applications, but the BITS 1.5 features allow you to perform more complicated tasks like selling updates or handling interaction between the application and the server.
Abstraction is key to programming. One should choose how abstract one needs
to be carefully. Beginning programmers in their enthusiasm often create more
abstraction than is really useful. One sign of this is if you create classes that
don't really contain any code and don't really do anything except serve to ab-
stract something.
You think they are talking about struts?
love is just extroverted narcissism