Главная » Просмотр файлов » Nash - Scientific Computing with PCs

Nash - Scientific Computing with PCs (523165), страница 31

Файл №523165 Nash - Scientific Computing with PCs (Nash - Scientific Computing with PCs) 31 страницаNash - Scientific Computing with PCs (523165) страница 312013-09-15СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 31)

For example, text files in MS-DOS arefrequently ended with a Control-Z character (ASCII 26). Comparison should stop when the end-of-filemark is detected in one of the files being compared. Everything works well if files are of the same lengthand are identical, byte for byte. The file comparison may give confusing output if it is not following the"end of file" convention and compares "data" in the unused space beyond the marker. Another problemmay be that one application program puts in the marker, while another relies on the file length held inthe directory.We use a shareware COMPARE program for quick looks at differences between two files, but use the MSDOS utility FC for a serious comparison of differences between text files.

The MS-DOS COMP utility ishelpful for comparing two sets of files or two directories, for instance, in checking if there are changes88Copyright © 1984, 1994 J C & M M NashNash Information Services Inc., 1975 Bel Air Drive, Ottawa, ON K2C 0X1 CanadaSCIENTIFIC COMPUTING WITH PCsCopy for:Dr. Dobb’s Journal(and in which files they are located) between two ostensibly different releases of a set of files.10.5 Directories and CatalogsA file catalog utility (Section 5.3) is most helpful for workers who have large collections of exchangeabledisks or tapes and who need a global listing of the files.Others may be able to manage their collection of files by segmenting the files into appropriate directories,with these directories localized on specific drives and machines on a network.

If duplicate directorystructures are used on unconnected machines, there must be procedures for maintaining equivalence ofthe files. Users must assiduously practice the discipline such procedures impose. In our own experience,this is next to impossible.All operating systems provide facilities for listing the names of files in a directory. File specifications withwildcards (Section 10.2) let us focus on particular names. There are also many utility programs that allowenhanced directory listings to be prepared.

We use one of anonymous authorship that allows us to displaya compact list of files sorted by name and giving the file size. Other display formats are chosen bycommand switches. A feature we use frequently lets us list the filenames to a file that we can edit tocreate a batch file to perform operations on the files.One reason we are less comfortable with Windowed operating environments (such as the MacintoshFINDER or Microsoft Windows) is that we have not found easy-to-use tools for arranging for actions tobe carried out by a script that we have prepared.

No doubt enterprising software developers will fill thisgap.10.6 Fix-up ProgramsFrequently, errors in programs, failures in electronic or mechanical components or mistakes by operatorsleave some aspect of our system or its files in an improper state.•Interrupting a program after it has written data to a file but before the file is properly closed mayleave the file unreadable to programs.•Occurrence of a scratch or bad spot on magnetic media will always cause some data loss, but we willwant to be able to recover most of our data.

We may subsequently instruct our PC to avoid writingto or reading from the offending block of storage.•Accidental change to or deletion of a file, e.g., by giving the name of an existing file to store programoutput, may cause an end-of-file marker to be written at the beginning of the space occupied by thefile.The correction of these problems requires their diagnosis and a tool to fix them. Some difficulties arecommonplace enough that there are operating system or other utilities available to help. An example isan "UNDELETE" program; these use the fact that deletions usually only alter the filename in the directory,so that clever software can put the right name back and recover the file. Such programs generally refuseto operate on networked drives. For fixing files, we generally must do much more work.

The expert’s toolof choice is the sector editor that allows access to the raw binary data on a disk. We can do much damagequickly if not careful.When the directory is corrupted by some error, access to files is no longer reliable. Operating systemsprovide some mechanisms for verifying the integrity of the directory structures, e.g., MS-DOS CHKDSK.More comprehensive tools automatically check and "fix" a variety of disk problems, e.g., Norton DiskDoctor.

Some provide a certain level of preventive maintenance in refreshing the disk format without dataloss, e.g., SPINRITE.10: UTILITIES - A DESIRABLE SET89Defragmentation of files may also be considered as preventive maintenance, since contiguous data isstraightforward to recover, particularly if it is in text form (Section 8.4).Over the years, users develop small utilities to repair file deficiencies.

We quite frequently find that anapplication program cannot cope with a text data file stored with "carriage returns" (ASCII character 13)at the end of each line, instead needing a "carriage return / line feed" (ASCII 13, ASCII 10) sequence asmarker. We wrote a very simple BASIC program to do the fix-up called CRTOCRLF.BAS, but a varietyof such tools exist (J C Nash, 1993a). Sometimes it is enough to read a file into a text editor and savingit again. Similarly, programs may be devised to display and work with special characters, e.g., in namesof files, where they cause trouble.

For example, it is not possible to delete a file that has a space in themiddle of its name using the MS-DOS command ERASE; the command interpreter takes the material afterthe space to be a second parameter to the command.Other utilities we have written ourselves include a small program to strip blank characters from the righthand end of text lines (RBLANK) and LINES, which counts the lines in a text file and lists the five longest.These are used when we want to send text data to a printer or electronic mail where overlength linescause misalignments or lost data.Users who do not wish to program may have difficulty in finding sources of good fixup programs.Unfortunately, the descriptions of the kinds of errors that may occur can be long enough to discouragetheir inclusion in advertisements.

We recommend keeping in touch with a local PC users’ group orbulletin board where advice may be sought from others.A common cleanup (rather than fixup) problem occurs when disks contain obsolete information and wewant to recover them for reuse. Reformatting may take up to two minutes per disk, and generally ties upour machine. We have had limited success with background formatting, which allows formatting toproceed while we are doing other work. We prefer to use a very quick reformatting program that simplyblanks out the disk control sectors and directories (QDR, The Quick Diskette Reformatter Version 3.3c,Vernon D. Buerg 1988). Note that if the disk is exposed to magnetic fields, it should be formatted usingthe tools supplied with the operating system.Finally in the category of fixup programs we will mention computer virus control programs.

These fallinto three categories: scanning programs that look for specific code segments peculiar to different viruses,behavior monitors that watch for unusual disk or memory activity, and bait programs that watch forchanges in their own structure. Viruses, which is the term we will use as a catchall for all intentionallydestructive software (see Denning, 1990, for more details), require some code to be executed in order togain a foothold in a computer.

Once executing, they seek an opportunity to propagate. Clearly they cannotinfect read-only devices. Unfortunately, small segments of code are executed when most disks are read,so even simple DIR commands may result in infection. We recommend running a simple scanningprogram against any disks received. Removing viruses requires that we have good backup copies of ourfiles. As the operating system is a favorite target of viruses, we may have to reinstall it.10.7 SortingFrequently we need to sort data so as to use it effectively. Address lists are an obvious example, especiallyif we need to reorganize them so they are in postal code order. Similar tasks occur in scientific dataanalysis if we wish to look for spatial relationships.Sorting text files is trivial if the files are small. In MS-DOS there is even a SORT utility provided.Alternatively, we can use sorting functions in a spreadsheet.

Large files give more troubles. If a databasemanagement program is available, then it may be used. Many shareware programs exist. For example,QSORTL by Ben Baker allows large files, long line lengths, multiple sort keys and a lexicographic sort,that is, capital and lower case letters are not separated as they are by the ASCII collating sequence. Weurge special attention to the collating sequence if lower case letters are present, or if special or accentedcharacters appear.90Copyright © 1984, 1994 J C & M M NashNash Information Services Inc., 1975 Bel Air Drive, Ottawa, ON K2C 0X1 CanadaSCIENTIFIC COMPUTING WITH PCsCopy for:Dr. Dobb’s JournalNumeric data may be sorted using features within a statistical or database package. Alternatively,conversion to text and use of a text sorter is possible. However, we need to ensure that the data iscorrectly aligned by column position or we will get 10 following 1 and 22 following 2.

The same problemoccurs in ordering the lines in a BASIC program. We generally load or merge files within a BASICinterpreter to sort the lines automatically, but have had occasion to write a program to do this so we couldconsolidate segments of code automatically using a batch file. Note that the interpreter allows us torenumber program lines.

We must remember to SAVE the program, of course, and to do so as text.Previous Home Next11: HARDWARE AND OPERATING PRACTICE91Chapter 11Looking after the Baby:Hardware and Operating Practice11.111.211.311.411.511.611.711.8Cleanliness and a decent physical environmentBad habits — smoke, sticky fingers, games, petsMagnetic disks and their careTapes, CDs and other storage mediaPower considerationsInterference and radio frequency shieldingServicing and spare partsConfiguration maintenanceIn this chapter we consider ways in which the environment of the PC and the manner in which it ishandled can minimize the incidence of "glitches" or breakdowns. Most of the measures suggested aresimple to set up. They arise out of a common sense approach to the PC.

Like any human or machine, aPC will give better service if it is well-treated.11.1 Cleanliness and a Decent Physical EnvironmentSome hazards that a home or office presents to a PC, apart from those associated with the power socket,are:•Dust and dirt;•Heat or cold;•Humidity or dryness leading to static electricity.In many respects, the treatments for these problems are highly interrelated, but the various steps will beconsidered one at a time.Keep the PC and its area clean and tidyUsually, simple dusting with a slightly damp (not wet) cloth is sufficient for exterior cleaning of PCequipment. We avoid the use of any chemical cleaning agents for fear of contaminating switches, keys,circuit connectors or magnetic recording surfaces.

Where grease or grime are present, a mild cleaningmaterial such as dish washing liquid may be used. Spray-on chemical cleaners should be avoided unlessthey are specifically designed for cleaning of electronic equipment. As most ordinary household cleanerscontain sodium hydroxide (caustic soda), care should be taken so no cleaner gets inside the equipmentor on sensitive surfaces such as monitor screens.Since dust can be a problem inside equipment (especially printers), it is helpful to have good filters or aircleaners for the heating or air conditioning of the office.

Характеристики

Тип файла
PDF-файл
Размер
1,45 Mb
Тип материала
Учебное заведение
Неизвестно

Список файлов книги

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6363
Авторов
на СтудИзбе
310
Средний доход
с одного платного файла
Обучение Подробнее