text:
User talk:Zania brown

Hello.every one im zania im new here wana be my friend and im looking for a boy friend

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: User talk:Zania brown


text: User:AryaMRS

title: User:AryaMRS


text: User talk:AryaMRS

title: User talk:AryaMRS


text:
Wikibooks:Reading room/Administrative Assistance/Archives/2020/May

Vandalism
https://en.wikibooks.org/wiki/Special:Contributions/2402%3AB400%3A4083%3AC54C%3A0%3A0%3A33A7%3A28AC. Thanks. Hasley (discuss • contribs) 15:31, 5 May 2020 (UTC)
 * Blocked, nuked. --Pi zero (discuss • contribs) 18:12, 5 May 2020 (UTC)

Vandalism
Special:Contributions/98.158.58.200 - no warning sent; its a long term abuser vandalizing lots of pages. Please block --DannyS712 (discuss • contribs) 01:53, 8 May 2020 (UTC)
 * Blocked. --Pi zero (discuss • contribs) 02:01, 8 May 2020 (UTC)


text:
Free Knowledge Culture Calendar/February 2

Today in 2003 the ReactOS project made its first release. However, the first version with a working GUI came almost a year later and development is still in alpha stage.


text:
Free Knowledge Culture Calendar/September 16

Today in 2013 Valve co-founder and executive director Gabe Newell famously stated his conviction that “Linux and open source are the future of gaming“ and that the company helps game developers achieve Linux compatibility. Valve followed up on its promises with SteamOS, Steam Machine and Proton, among others.


text:
User:Yaqub Kabanoki

See my Wikipedia user page for info.

title: User:Yaqub Kabanoki


text:
Oberon/ETH Oberon/genealsys

ETH Oberon System Genealogy Tree

Note: Suggestions for corrections and hints for improvement are welcome. The dates are approximative.

Genesis of the Oberon System and its ports Genesis of the ETH Oberon (formerly System 3) and its ports ''10 Jul 2000 - Copyright © 2000 ETH Zürich. All rights reserved.''

E-Mail: oberon-web at inf.ethz.ch

Homepage: http://www.ethoberon.ethz.ch

title: Oberon/ETH Oberon/genealsys


text:
Oberon/genealsys

ETH Oberon System Genealogy Tree

Note: Suggestions for corrections and hints for improvement are welcome. The dates are approximative.

Genesis of the Oberon System and its ports Genesis of the ETH Oberon (formerly System 3) and its ports ''10 Jul 2000 - Copyright © 2000 ETH Zürich. All rights reserved.''

E-Mail: oberon at lists.inf.ethz.ch

Homepage: http://www.ethoberon.ethz.ch

title: Oberon/genealsys


text:
Clipper Tutorial: a Guide to Open Source Clipper(s)/Getting Started

Getting Started

As seen above, in practice, (x)Harbour permits a great versatility, as it (they) can be used in four different ways:
 * 1) by running hbrun or xbscript and executing instructions interactively (much like a BASIC direct mode or immediate mode, although it is more similar to the dBase dot prompt). The main limit of this approach is that it cannot run expressions longer than a single line (but it is possible to enter more instructions on a line separating them with semicolons). However, much of my tutorial is thought to be entered, tested and understood one line at a time.
 * 2) by calling hbrun or xbscript specifying a .prg file as a line argument to execute it (which is again like specifying a file to run when invoking a BASIC interpreter)
 * 3) by compiling the file to a bytecode using the /gh option of the Harbour compiler and then running the resulting .hrb bytecode file with hbrun (this is similar to Java's workflow when you call the compiler javac and then the Java interpreter on the bytecode file)
 * 4) by using the Harbour compiler, C compiler and linker to get an executable file (utilities are given to get all the steps done in a single command)
 * 5) by using the compiler through an IDE

There are also commercial RADs, like Xailer (https://www.xailer.com/) or xHarbour Builder (https://www.xharbour.com/).

Antonino Perricone wrote an extension for Visual Studio Code, which is well documented at https://github.com/APerricone/harbourCodeExtension/wiki, https://medium.com/harbour-magazine/visual-studio-code-for-harbour-e148f9c1861a, https://harbour.wiki/index.asp?page=PublicArticles&mode=show&id=190401174818&sig=6893630672. The main problem with the precompiled version of Visual Studio Code is that it's not under the MIT license.

https://github.com/Petewg/harbour-core/wiki/Make-tools

xMate IDE: https://github.com/Petewg/MgM/tree/master/comp/ide

Packages providing syntax highlighting for various editors are available: for Sublime Text (https://www.sublimetext.com/) is available at https://github.com/asistex/Sublime-Text-harbour-Package, for SynWrite (http://www.uvviewsoft.com/synwrite/) at https://github.com/rafathefull/synwrite, for Atom Editor (https://atom.io/) at https://github.com/AtomLinter/linter-harbour, UltraEdit at http://forums.ultraedit.com/syntax-highlighting-wordfile-for-harbour-fivewin-t17880.html. I myself like Scintilla (https://www.scintilla.org/), a lightweight open source editor that supports the xBase syntax highlighting under the name Flagship - which is an implementation different from the open source ones we are considering but that does not make much difference and it's anyway highly configurable.

Using Harbour From a Windows Command Prompt
Simply open a command prompt and move to the directory where you store your sources. Issue a PATH command pointing to the bin directory of your Harbour system (this is to avoid problems if you've got different compilers in your system). I also add the path of a text editor to use from the prompt, like this:

D:\harbourcode>PATH c:\hb32\bin;D:\wscite

Getting Started With hbIDE
https://hbide.vouch.info/

 * 1) To create a new project, select File > New > New Project Wizard (Prototype Only) . We will name this project hbidetest, enter the path C:/hb32/projects/hbidetest.hbp and click Save and Close.
 * 2) Select File > Open Project in the menu bar.
 * 3) Right click the project hbidetest in the projects dock on the right and " Set as Current " project.
 * 4) Select File > New > Source and create a file hbidetest.prg with the following content:
 * 5) Double click hbidetest in the projects dock so that the and click the Select Sources button near the Project Output text box, then select Save and close . It is a button not very well indicated - I think a button clearly stating "Add source file" would have been better. Select Sources Button Position in HbIDE.png
 * 6) Now after selecting Build > Build and Launch our program will show up.


text:
Clipper Tutorial: a Guide to Open Source Clipper(s)/Working With Databases

Working with Databases
Let's return to the Wikipedia entry Database application.

Different kinds of database applications exist as well. If you did store your friend's phone numbers and addresses into a word processor, you would have what someone calls a Free-Form Database (however, a similar expression is an oxymoron in computer science) - myBase®, askSam®, Personal Knowbase®, MyInfo®, Info Select®, and GeneralKB® are a bunch of specialized free-form database application, which actually means PIM (Personal information manager). Now, a word processor lets us search the information, but other operations, such as sorting them in alphabetical or numerical order, cannot usually be done automatically by a word processor.

What about attempting to store it into a spreadsheet? We may use one column for the name, one for the surname, one for the telephone number, one for the city. This quick database, stored in a spreadsheet, may be searched and sorted: for example, we can sort it by city and person's name in alphabetical order. This is a flat database, http://www2.research.att.com/~gsf/man/man1/cql.html: a flat database is a sequence of newline terminated records of delimiter separated fields, and a spreadsheet shows its limits in data entry and reporting (if you did want to use the data in your table to print out addresses on envelopes a spreadsheet is not a good tool). An example is MyDatabase (http://www.pcmag.com/article2/0,2817,760833,00.asp).

Spreadsheets are much better to do accounting: how much harder a book-keeper's work would be if his data were stored in a wordprocessing program? The purpose here is to have our data structured in a certain way: all the costs in a place, all earnings in another.

Before 1970 complex databases were managed using Hierarchical Databases (very little information is needed about them - see for example http://www.extropia.com/tutorials/sql/hierarchical_databases.html and http://people.cs.pitt.edu/~chang/156/14hier.html). An example of a hierarchical database is IBM IMS (Information Management System, which was developed during the mid-1960s for applications in the aerospace industry). Their implementation is based on trees, a hierarchical data structure. Hierarchical Databases and Network Databases together form what today are referred to as Legacy Database Systems. Network databases were born as an extension to the programming language COBOL by the Conference on Data Systems Languages (CODASYL). The network data model is based on data structures called graphs.

Today's standard is the Relational Database (RDBMS), which is "a database with relationships between more than one table of records based on common fields". We will speak of them in some detail, but we will briefly mention the fourth approach: Object Oriented Databases. These databases store objects (in the same sense the word is used in the expression object-oriented programming). They're not much used, mostly because objects are more complex than the simple fields a relational database stores in its tables. More information on the topic at http://www.odbms.org/odmg-standard/.

The Wikipedia entry about DBase reads: «dBase is application development language and integrated navigational database management system which Ashton-Tate labeled as "relational" but it did not meet the criteria defined by Dr. Edgar F. Codd's relational model». Codd's criteria (the so-called 12 rules, which really are 13 because the rule numbered '0' actually exists) are so strict that in practice a true relational database system does not even exist, but the point is that dBase accessed databases in another way, so that it's considered a Navigational Database (which works in a way that simulates relational databases).

http://www.databasedev.co.uk/design_basics.html

DBF Files in Other Languages
Because of the great success of dBase and its, the DBF file format became an industry standard. Many other database programs have used them to store data, like Lotus Approach. We also have many little utilities to view and convert to other formats these files. Here is a bunch of URLs: https://dbfview.com/, http://www.alexnolan.net/software/dbf.htm, https://dbfviewer.com/en/, https://www.dbf2002.com/, http://www.whitetown.com/dbf2sql/ («DBF to SQL Converter allows you to convert your dbf files to SQL script. Personal license $29.95», but compare https://www.vlsoftware.net/exportizer/). And is so widely used that interfaces for working with it are available for various languages, for example:

 * C++
 * https://sourceforge.net/projects/xdb/, http://linux.techass.com/projects/xdb/xbasedocs/xbase_c1.html and http://linux.techass.com/projects/xdb/ Xbase (formerly known as xdb, also formerly known as xBase) is a collection of specifications, programs, utilities and a C++ class library for manipulating Xbase type datafiles and indices.
 * Python
 * https://sourceforge.net/projects/xbase-py/ A Python interface for managing dbf files
 * Java
 * https://sourceforge.net/projects/xbasej/ xBaseJ - xBase Engine for Java
 * Links for PHP interface:
 * http://www.ira.inaf.it/manuals/php/ref.dbase.html
 * http://php.net/manual/en/ref.dbase.php
 * http://www.nusphere.com/kb/phpmanual/ref.dbase.htm?
 * https://sourceforge.net/projects/sfdbase/ a SQL parser for dbase

Well, now we will see how to work with DBF files the way it was intended.

A verbose way
The code above created a DBF file, names.dbf, to be used by the following code. It will add a record to the DBF file. It is equivalent to the "First Sample Program" of my old PC GUIDE, which missed a line that is necessary in modern xBase. The CLOSE command is equivalent to the dbCloseArea function, which closes a work area: Pending updates are written, pending locks are released.

A more concise way
The short code below does the same work of the two pieces of code of the previous section (it only produces a different file name, namesdb.dbf instead of names.dbf).

This example uses the alias operator, ->. http://www.ousob.com/ng/clguide/ngcf412.php

The alias->field_name notation is used to allow access to fields of databases that are loaded but not active. The alias can be specified with the work area number (e.g. 2->std_id), with the work area alias (e.g. B->std_id), or with the database name (e.g. STUDENTS->std_id).

The result of this code is a file named namesdb.dbf. Informations about how DBF files are can be find at DBF File structure, http://www.dbf2002.com/dbf-file-format.html, where we find this list of Field type:
 * C  –   Character
 * Y  –   Currency
 * N  –   Numeric
 * F  –   Float
 * D  –   Date
 * T  –   DateTime
 * B  –   Double
 * I  –   Integer
 * L  –   Logical
 * M  – Memo
 * G  – General
 * C  –   Character (binary)
 * M  –   Memo (binary)
 * P  –   Picture
 * +  –   Autoincrement (dBase Level 7)
 * O  –   Double (dBase Level 7)
 * @  –   Timestamp (dBase Level 7)

My PC GUIDE showed how a .dbf file is made with the DataBase Utility DBU. Clones of this utility are FiveDBU (with source code) at https://code.google.com/archive/p/fivewin-contributions/downloads, DBF Viewer Plus at http://www.alexnolan.net/software/dbf.htm, CLUT at http://www.scovetta.com/archives/simtelnet/msdos/clipper. Harbour includes its own HbDBU (the source is in \hb32\addons\hbdbu ) and a component IdeDBU of HbIDE (the other two components are IdeEDITOR and IdeREPORTS).

From https://code.google.com/archive/p/fivewin-contributions/downloads we can get fivedbu_20130930.zip (New FiveDBU version with enhancements on ADO fields editing). It supports ADO, 3 RDD (DBFNTX, CBFCDX and RDDADS) and 6 languages - select "Bases de datos -> Preferencias -> Lenguaje: Inglés" to have it in English.

Let us see what is in our little file so far.

Database Design Issue: the First Normal Form (1NF)
The work done in the previous section was intended to exactly reproduce the database presented in my PC GUIDE. There are, however, drawbacks: having only one NAME field, this database cannot sort its data on the last name. Also, a careless user might insert the data of some people with the last name first, and some other data with the first name last. When designing a database precautions should be taken of these possibilities. The first normal form (http://www.1keydata.com/database-normalization/first-normal-form-1nf.php, http://www.sqa.org.uk/e-learning/SoftDevRDS02CD/page_14.htm) requires you to define fields whose information cannot be divided into smaller parts. So, instead of a NAME field, we should have a FIRST_NAME and LAST_NAME fields. Complying to the first normal form, our little database would be on the on the right track to being a normalized database.

Designing the database is an essential part of the work and it is not always obvious how it should be done. See https://www.ntu.edu.sg/home/ehchua/programming/sql/relational_database_design.html.

A graphical device used to help is database design are the Entity-Relationship Diagrams: https://www.lucidchart.com/pages/er-diagrams, https://www.guru99.com/er-diagram-tutorial-dbms.html.

Complicating our simple database
Harbour contains a file named test.dbf. Launch hbrun in its directory and type in

use test browse

At this point, we see that it is a 500 record table. Move around with the cursor keys and, when you're finished, punch the Esc key to quit this interactive table browser and editor. To get the record number of a person called Ted issue:

locate for first="Ted" ? recno

Something More Elaborate
We may now try the use of hbrun interactively to solve an exercise from an ECDL book. ECDL (European Computer Driving Licence, https://www.findcourses.co.uk/inspiration/articles/why-does-ecdl-matter-17580) is a qualification to show that someone can use a computer with different degrees of proficiency. When I got it, many (many) years ago the tasks for the database module very extremely easy. It was the 5th module the one that dealt with databases. I bought a small book and rereading it I found inspiring the 2nd exercise in that module: create a table to manage a movie library. I've done this in Harbour 3.0 under ReactOS 0.4.13, using hbrun almost interactively - which gives it an enjoyable dBase feel. However it is necessary to use some auxiliary files, as some commands are quite difficult - or impossible - to type on a single line. That is not bad, we'll see how to run a piece of code stored in a file from the prompt.

 Point 1 . Turn on the computer and open the database manager - as absurd as it seems, the first step of every exercise in my workbook is to turn on the computer.

The first command to issue will set the window to 25×80 characters, so that it looks good on screen and nothing is out of sight.

At this point we should see more or less this (probably your screen won't be in Italian):

The first line shows the last command hbrun executed, setmode(25,80), and the bottom line features the legendary Dot Prompt.

 Point 2 . Create a table to manage a movie library with the following fields:

 * movie code,
 * movie title,
 * genre,
 * year of production,
 * leading actor,
 * price in euro.

We can issue all the following commands at the Dot Prompt to create a database with this structure:

or we can store them in a file, for example creadb.prg and invoke from the command line using:

Now we can check what is in our working directory:

this command will show the name of all databases in the current directory. We should have something like:

Database Files    # Records    Last Update     Size videolib.dbf              0    09/15/21         227

and begin using out database:

the first two lines should now read:

 Point 3 . Create a form to enter data - this we will do later. We will see how it is done: the @...GET command places the input fields on the screen and allow users to enter data. A typical procedure looks like this:

 Point 4 . Fill the table with at least ten records with different data.

We will get our sample data from the CSV file "movies.txt" shown below using the command

1,"Jurassic Park","azione",1993,"Jeff Goldblum",35.99 2,"Jumanji","avventura",1995,"Robin Williams",8.49 3,"Navigator","fantascienza",1986,"Joey Cramer",11.39 4,"Mortal Kombat","azione",1995,"Christopher Lambert",10 5,"Karate Kid 4","azione",1994,"Hilary Swank",4.9 6,"Ritorno al futuro","fantascienza",1985,"Michael J. Fox",6.95 7,"2001: Odissea nello Spazio","fantascienza",1968,"Keir Dullea",7.9 8,"Il pianeta proibito","fantascienza",1956,"Leslie Nielsen",9.99 9,"Interstellar","fantascienza",2014,"Matthew McConaughey",6.95 10,"Prometheus","fantascienza",2012,"Michael Fassbender",7

We may check the data currently in our database using:

Now we can make some small changes to our sample data. For example the data of the Genre field are in Italian, but we would like to have them in English. The commands to do the substitutions are surprisingly simple: .replace genre with "science fiction" for genre="fantascienza" .replace genre with "action" for genre="azione" .replace genre with "adventure" for genre="avventura"

In the same way we can translate the Italian movie titles with their English equivalents ("Il pianeta proibito" is "The Forbidden Planet", "2001: Odissea nello spazio" is "2001: A Space Odyssey" - but that was easy to guess -, "Ritorno al futuro" is "Back to the Future").

The movieid field is a simple number, and that's ok but, to spice things up, let's try to change it with this command:

At this point we can already try and extract the list of films made before the year 2000:

to see how to enter multiple commands at the Dot Prompt, just separate them with a semicolon. Here we can see also how a dBase command is built:

list - a verb title, leadactor, year - an expression list for year < 2000 - a condition

However, those three question marks to make some space to see all the records (the first three lines of hbrun are occupied by other information) are just ugly. Next time we will use setpos.

Now that we think about it the movie code field, Movieid, in record 7 consists only of numbers and in record 8 contains a space, which is just as ugly. We can correct it interactively by entering at the dot prompt:

and replace those fields with "Odys68" and "Forb56".

Since we are making corrections, I just remembered that I gave away 2001: A Space Odyssey in change of a better movie, and so we may as well delete it:

Now we can browse again and add a new record by hand: "Miss86", "Mission", "history,drama", "1986", "Jeremy Irons", "6.95".

 Point 5 . Sort the table by film title.

Again,  will permit us to make sure things actually changed in the way the file appears.

 Point 6 . Query the database for films made before the year 2000

We’ve already done this, but this time we have the index on the field Title active:

What else we can do? We can also also compute the average age of our movies (in years):

(maybe i should watch more recent movies...), or see how much we spent on our movie collection:

 Point 7 . Create a report named "Movie List" with the records of the films in order of genre and title and containing the fields code, genre, title, price in euro.

The DOS dBase had its own Report Generator and Clipper provided an utility, RL.EXE, to create reports and labels. Those programs create a format file used to generate the report, in those ancient times when reports were printed on continuous form paper using dot matrix printers. But how can we create a report today? How to preview it onscreen before sending it to the printer? Probably the most obvious options are to create a PDF or HTML file (which will then need a stylesheet to be watchable, otherwise it'll be too insipid). Since I'm using a vanilla Harbour 3.0 to start we will follow the simplest way: generate an HTML file. We will try a tabular report (this code needs to be corrected, as the HTML it produces although can be interpreted, cannot be validated as many closing tags are missing):

This is not much to look at, but a CSS will improve its appearance considerably. Even a messy CSS (this too needs a clean up) like this:

can get us a colorful printed report that does not look dull - albeit unprofessional:

 Point 8 . Print the "Movie List" report.

 Point 9 . Close the database and the program. In hbrun these two things are done with these two commands, respectively:

What have we left within our working directory? reports the following:

iReport ntx     2048  09/15/21 movies  txt      605  09/15/21 report  prg      414  09/15/21 rMovie  htm     1290  09/15/21 styles  css      743  09/15/21 titlesor ntx    2048  09/15/21 videolib dbf    1287  09/15/21

Note 1. Using HTML for output is fun, but it is not a good idea, as often a report will be longer than one page of paper and an HTML+CSS table will not handle properly such multiple pages output. Creating a PDF of the report to print, using either libHaru (http://libharu.org/) using the bindings of contrib\hbhpdf (or extras\hbvpdf) would be a much better choice.

Note 2. This example is really basic. We could do just about everything using the Dot Prompt in less than 20 minutes. ECDL has changed a lot during the last few lustra. Now I'm giving a look at the ECDL Advanced Database Syllabus 2.0. It looks good, with some interesting exercises.

Workareas: more than one table at once
Let us for a moment think back at the old times when commonly used computers had no mouse and GUI. Nevertheless, if we wanted to use several tables for a task, we had to use some way to tell the computer which tables he should consider. Let us take for example a library. Oversimplifying, we need to use at least three tables to manage it (one for the books, one for the customers and one for the loans).

We might issue these commands:

SELECT 1 USE Books SELECT 2 USE Customers SELECT 3 USE Loans SELECT Books

We might visualize the result as the three windows in the picture below:

Here the command SELECT works like clicking on a window to activate it, and the workareas themselves look like windows having a number (the workarea number) and a name (the workarea alias).

Testdbf.prg
Here is the testdbf.prg source from \hb30\tests. It should be discussed in detail. It is a GPL piece of code poorly commented.

Input Mask
A simple data base input mask (from the Wikipedia Clipper entry):

RDDs: What Functions Are Available?
http://harbourlanguage.blogspot.de/2010/06/understanding-harbour-rdd.html

ADO RDD: Much Ado About Nothing
https://searchsqlserver.techtarget.com/definition/ActiveX-Data-Objects http://cch4clipper.blogspot.com/2009/10/using-adordd-with-harbourxharbour.html

Case Study: Checkbook Balancing
This is CHECKD.PRG from x2c-base.zip\Tutor.zip:

Deleting records
In this piece of code, the command DELETE marks the fourth record for deletion. But the file is not altered, not even by a CLOSE command. The PACK command actually removes the records marked for deletion (and also makes some additional work). The RECALL command removes the deleted flags. The function DELETED returns .T. if the current record is marked for deletion, .F. if not.

The PACK command, which does the actual deletion of data from the table, '''PACK requires that the current database be USEd EXCLUSIVEly. If this condition is not met when the PACK command is invoked, CA-Clipper generates a runtime error'''. Additional work that PACK does is to update indexes on the table it alters (if any).

The commands DELETE ALL and PACK are executed by a single command called ZAP.

An Indexed Example
Suppose a table containing these data:

FSTNAME	LSTNAME John  	Doe John  	Doe John  	Doe Jane  	Doe

We can create a little index file with this piece of code:


text:
Clipper Tutorial: a Guide to Open Source Clipper(s)/Object Oriented Programming

Object Oriented Programming
Clipper had very limited support for OOP (Object Oriented Programming, from now on we’ll call it by its nickname). His successor CA-Visual Objects was much more advanced in this respect. However Visual Objects never had a great success, and third-party producers provided OOP libraries for Clipper, among which the most famous were Class(y), TopClass, Fivewin and Clip4Win.

Looking at Object-Oriented Programming from a Safety Distance
Let us suppose we're dealing with the distance function given the Cartesian coordinates of the points (http://mathinsight.org/cartesian_coordinates). The formulas we'll apply are:

$$D_1 = \sqrt{(x_2 - x_1)^2}$$

$$D_2 = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$$

$$D_3 = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}$$

for (Euclidean) distance on a real line, Euclidean plane and Euclidean space respectively.

In procedural programming our functions would look like this:

We defined three functions, with different names, which take as arguments the coordinates. But doing so we need to pass six arguments for the distance in a three-dimensional space.

If we're doing it with object oriented programming we may get something like this:

Here we've defined three classes, their constructors, and a distance method for each of them, and showed how to use them. It is also a simple example of how inheritance works. Other concepts are encapsulation (information hiding or data hiding), abstraction, polymorphism, overloading and overriding of methods. Inheritance plays a central role in a key concept: reuse. A class can be reused in a software project if it is exactly what was needed; or if it is not exactly what was needed it can be extended by defining a subclass. Much like the design of a database, the design of object oriented class is an art with its principles, see for example http://www.oodesign.com/, http://www.codeproject.com/articles/567768/object-oriented-design-principles and pages about UML like http://www.uml-diagrams.org/uml-object-oriented-concepts.html.

The first thing to note is that we start by including the clipper header file hbclass.ch, the header file for Class commands.

Access to variables and methods of an object is done via the colon operator. A prepended double colon refers to variables with a larger scope (such as those passed to a method).

In the code above we defined three classes, each one implementing a Point. Point2D for example was defined as a class extending Point1D, that is a generalization of the concept. A method Distance was given for each of the classes.

A line such as  ? FifthPoint:Distance( SixthPoint ) contain the output command ?, the reference to an object (FifthPoint in this case), an invocation of the Distance method :Distance, to which another point was passed ( SixthPoint ).

It is also possible to write a Distance function which takes two arguments of a Point class, that may look like this:

This is, however, not object-oriented programming, as we could have written the same function with a not object-oriented language such as Pascal or C, passing it two structs, or records as Pascal calls them, named Point1 and Point2.

It is important the fact that some data internal to the object (set by the real programmer of the thing) can't be changed by the object user. As a real life example, we can consider a car engine. The provider of the object set a number of cylinders, and we have not many chances of changing that: we've got to regard it as a constant. There is naturally a number of interesting formulas about engines that engineers use (some to be seen at http://www.thecartech.com/subjects/engine/engine_formulas.htm). For example, the one for computing the Engine Volumetric Efficiency given the volume of air taken into a cylinder and the cylinder swept volume. Here comes the importance of data hiding: nobody needs to know those informations to get his car going. Also, when someone designes an engine they probably don't expect the user to change the volumetric efficiency by operating on the engine. The same thing is obtained in object oriented programming using visibility modifiers, or access modifiers.

Another example
Copied verbatim from Harbour (software)


text:
Clipper Tutorial: a Guide to Open Source Clipper(s)/Other Features (Not Present in the Old Clipper)

Hash Arrays (Associative Arrays, Also Known as "Hash Tables")
In an associative array the elements are accessed using a string and not a number as in the "normal" array.

There are online "Calorie checkers" (which are also a nice idea for a web application for the last part) and I think it will be fun to make us a very small one (BEWARE: the information obtained from this program should not replace a varied, balanced diet and a healthy lifestyle).

Now we will redo the example of the array of months, showing an alternative syntax for loading data into an hash array:

hb_HEval is the AEval equivalent for hash arrays.

See https://vivaclipper.wordpress.com/2013/01/18/hash-vs-table/.

Morse Code
Morse code was invented around 1840 by Samuel Finley Breese Morse and Alfred Vail to transmit messages across wires using devices called "telegraphs" they invented as well, revolutionizing long-distance communication. Initially the signals sent from one telegraph operated an electromagnet on the receiver's telegraph embossing the message on a strip of paper, later the receiver could also produce a sound. The first message transmitted was a citation of the book of Numbers from the King James Version: What hath God wrought!

Let us try to convert a text to Morse code: to begin we load the chart of Morse code in an associative array and define a code block which uses the function TONE to sound a speaker tone for a dot or a dash - employing the IF function - which is essentially the same function we encounter in spreadsheets - to select the right duration tone.

Then we prompts the user for a message and if none is supplied it uses the pangram "The quick brown fox jumps over a lazy dog" (a pangram is a sentence that contains all of the letters of the alphabet).

We show what message we will translate and starts two a for each loop: the first will scan the message showing which letter it will translate, one at a line (and will also use TONE with zero frequency and appropriate lengths to make the pauses between letters and words) and then a nested for each loop will show whether it is about to sound a dot or a dash, running the code block to have the right sound.

Regular Expressions
Regular expressions can be considered an extension of wildcards. In a DOS or Windows prompt, for example, we could list all dbf files in the current directory with the command

dir *.dbf

where the asterisk, as they say, matches one or more characters. The other wildcard, the question mark, will match any character, but exactly one: the commands

dir ?.dbf dir ??.dbf

will show, respectively, every dbf file in the current directory whose name is exactly one or two characters long.

Regular expressions are much more flexible. They were invented by the mathematician Stephen Cole Kleene (the asterisk wildcard derives from an operator he defined and which is called Kleene star). Their flexibility allows us to write an expression that can match dbf filenames one or two characters long in a single expression which looks like this:

.{1,2}\.dbf

There are different types of regular expressions: basic, extended, PCRE (Perl-compatible regular expressions, http://www.pcre.org/), and many other different implementations.

As far as we are concerned we can limit ourselves to PCRE and refer to the documentation at these URLs: https://github.com/Petewg/harbour-core/wiki/Regular-Expressions and https://github.com/zgamero/sandbox/wiki/X_RegularExpressions, https://www.pcre.org/original/doc/html/pcrepattern.html, https://www.debuggex.com/cheatsheet/regex/pcre. There are large books entirely devoted about regular expressions, such as "Mastering Regular Expressions" by Jeffrey E.F. Friedl, just to say there's so much to explore about this topic.

Here https://www.rexegg.com/regex-cookbook.html is a cookbook to see examples; and here https://www.regexpal.com/ and here https://regexr.com/ there are interactive tools to try online (and interactively) expressions.

Regular expressions are not a panacea that solves all data validation problems: for example, it is not possible to use them to validate dates, as the number of days allowed for each month depends on the month (and in the case of February also on the year).

As a first example, we will redo the program that receives a letter from the keyboard and reports if it is a vowel or not.

The synopsis of hb_RegExLike is this: hb_RegExLike(|,  [, ] [, ]).

The next example is again the program to average of an array which grows until we insert numbers as input. This time we use a regular expression to validate the numbers we enter.

Error Handling With “Try-Catch-Finally” Block
This construct is analogous to those found in Java, JavaScript and C# (and similar to the C++'s one). They are actually translated into the BEGIN SEQUENCE structure and therefore perhaps they are useful only for those who are accustomed to those languages.

Multithreading
http://harbourlanguage.blogspot.com/2010/04/harbour-multi-thread.html

https://github.com/Petewg/harbour-core/wiki/MultiThreading

see samples in \hb30\tests\mt

INET
https://github.com/Petewg/harbour-core/wiki/Harbour-INET-API

PDF
hbhpdf: Libharu http://libharu.org/ bindings. Documentation: https://github.com/libharu/libharu/wiki/API%3A-Document

http://www.pagescript32.com/

https://github.com/MRonaldo/MR-Tools/downloads

How to create a DLL
http://www.xharbour.com/xhdn/referenceguide/index.asp?page=article&article=create_dll

Debugging
http://www.kresin.ru/en/debugger.html

You may have heard or read the legend that the term bug appeared when an actual bug was found in the Harvard's Mark II computer. According to one of my books from the high school, it was a little butterfly found in the ENIAC!

Text books less prone to folklore call this a story without foundation, for example https://www.computerworld.com/article/2515435/moth-in-the-machine--debugging-the-origins-of--bug-.html states that Thomas Edison used the word already in 1878. The same goes with the Wikipedia entry →Software bug which even includes a picture of the moth actually found in the Harvard Mark II and describes the whole history.


text:
English-Hanzi/Vitamin K2 deficiency or calcium malabsorption caused by high calcium/vitamin D may cause calcification of soft tissues

Vitamin K2 deficiency or calcium malabsorption caused by high calcium/vitamin D may cause calcification of soft tissues (arteries, cartilage, heart valves, etc.). This happens regardless of whether there is a mineral imbalance.

高钙/维生素D引起的维生素K2缺乏或钙吸收不良，可能导致软组织（动脉，软骨，心脏瓣膜等）钙化. 无论是否存在矿物质失衡，都会发生这种情况.


text:
User:Valtheophia/sandbox

My test

title: User:Valtheophia/sandbox


text:
Free Knowledge Culture Calendar/September 3

Today in 1995 eBay was founded as AuctionWeb. It was a convincing pioneer in the commercialization of the Web and is a very successful survivor of the dot-com stock market bubble.


text:
Free Knowledge Culture Calendar/October 8

Today in 1982 the inaugural meeting of the Consultative Committee for Space Data Systems (CCSDS) was concluded, an organization of the world’s major space agencies that develops international standard protocols for space communications.


text:
Free Knowledge Culture Calendar/November 16

Today in 1974 humanity made its first attempt at intergalactic communication by sending the Arecibo message. We have not yet received an answer from E.T., which will not be possible for about 60,000 years due to the stagnating progress in physics.


text:
Free Knowledge Culture Calendar/November 8

Today in 1956 the Hush-A-Phone v. United States case was decided. According to the decision, it is allowed to physically connect any device to the U.S. telephone network that does not interfere with its operation. In 1968 the FCC extended this privilege to electrical connections to the network. The ruling is considered a landmark for network neutrality, as it enables network use other than that intended by its operator, such as the use of answering machines.


text:
Planet Earth/7g. Earth’s Biomes and Communities

Biogeography
The best way to study the Earth is to travel. The study of the numerous varieties of life-forms on Earth is only appreciated when one travels across the surface, and notes the differences they see on their journey among the plants and animals they witness. Hence the study of life on Earth is linked to the physical geography of the planet in respect to the occurrence of different plants and animals, and the physical environment that they live within. This is largely due to specific adaptions that organisms exhibit to deal with the physical environment of each region. Hence, life in the dry deserts will exhibit different types of animals and plants than cold polar regions, while hot lush rain forests will exhibit a different diverse group of plants and animals unique to each region. The study of the geography of life is the fascinating field of biogeography. The study of biogeography likely has its origins in the work of Alexander von Humboldt, a wealthy German explorer who lived 200 years ago. Alexander von Humboldt hope to travel the world, but the raging Napoleonic wars in Europe had caused travel to be difficult, both for funds and permission to travel across warring nations. He had hoped to join a research ship to journey around the world, but the war caused the voyage to be canceled. He requested to join Napoleon Bonaparte in Egypt, but the French authorities in the army refused to bring him along. In 1799, Humboldt’s luck changed when Charles IV of Spain authorized his travel of the Americas. Between 1799 to 1804 Humboldt traveled across South and North America and wrote about the experience in his detailed scientific notes. When he arrived in the United States in 1804, he was summoned by Thomas Jefferson at the White House. Jefferson had just completed the Louisiana Purchase from France but knew little of the regional geography. He was eager to consult Humboldt. Humboldt had traveled extensively in Mexico, although his travel into the interior was somewhat limited, they both shared an interest in the animals and plants that might exist in these unexplored regions. The work of Humboldt had a major influence on the idea of nature; indeed biographer Andrea Wulf attributes Alexander von Humboldt as the inventor of the modern notion of nature itself (see Wulf, 2016). Humboldt and many of his age viewed two worlds on Earth, first the world of man containing farms and urban centers in the cities and towns and second the world of nature, the wild and unexplored regions of the Earth. This two-world view of Earth is still prevalent in the modern age. The primary reason for these early explorations funded by governments, was that plants and particularly the raw production of goods from those plants, such as cotton, sugar, coffee, tea, and various crops, were becoming increasingly in demand by growing populations. The discovery of tomatoes, potatoes and corn in the Americas made these early botanic explorations highly lucrative, particularly for the European monarchies that oversaw these colonies in the Americas.

There was intense interest in understanding the distributions of plants and animals on Earth, as they were viewed as an important raw resource, from furs brought back by trappers and timber from lumbermen to food and exotic spices. Biological exploration was tied to understanding the major biomes of the planet particularly during the years of colonization. A biome is a distinct biological community of plants and animals that have formed in response to a shared physical climate. Early geographers of the distribution of plants on Earth, such as the Danish naturalist Fredrick Schouw, provided early classifications of these various regions. Botanists like Franz Meyen in the 1830s were well aware that the local climate, and in particular the average and extreme temperatures and amount of moisture, were very important to explain the unique distributions of various species of plants and animals on Earth. The concept of zones or isotherms, using Humboldt’s term, are areas of similar climates, and hence tend to produce similar plant and animal species. Most important, these zones could dictate which types of plants and animal can be grown in each region of Earth. The history of sugar cane is an excellent case as to the importance of understanding biomes. Sugar cane, which is today a major source of sugar, originated in New Guinea, and was introduced into Southeastern Asia. The plant was then introduced to parts of the Middle East, but because of the dry climate, did not grow particularly well. Sugar was a rare medicine for much of Europe, and only eaten on rare occasions. With the discovery of the Americas in 1492 by Europeans, it was quickly recognized that the wetter and warmer climate of the Caribbean Islands and South America would be equally suitable for growing and harvesting sugar cane. The earliest sugar plantations were first established as far back as the early 1500s, and with the rapid rise of sugar cane in the New World, it became a very common import into Europe and across the Americas, particularly in places too cold for sugar cane to be grown. This shift resulted in the enslavement of millions of people, particularly from Africa for the continued harvest and cultivation of this plant in the Americas. Soon people in Europe where consuming sugar at much higher levels than ever before, with great demand for sugar in places where it was too cold for the plants to grow. Early biomes were mostly defined on a general description of the local climate, such as deserts, polar regions, or wet tropics, but others defined them based on particular types of plants that grow within them. For example, palm trees, sage brush, or cactus regions on maps.

In the 1860s, Wladimir Köppen traveled frequently on the newly constructed train from his family’s home in the warm southern Crimean city of Simferopol to the far cold north city of Saint Petersburg in northern Russia. The train journey of 2,110 kilometers (1,305 miles) is a nearly direct north-south transit across eastern Europe crossing many different climatic regions along the way. During the journey he would watch from the train the slow changes that occurred among the plant communities that he saw out the window, as they crossed each particular climatic zone. Later in his life, he would use the experience to develop the Köppen climate classification that was first introduced in 1884, and has been modified over the years into a geographic map of Earth that classifies the geographic zones of each of the major terrestrial biomes of the Earth. It is today referred to as the Köppen-Geiger climate classification based on improvements made by Ruldolf Geiger. The map is a precursor to the United States USDA Plant Hardiness Zone Map that has become in standard use by gardeners and farmers in the United States to determine if a particular plant species would be successfully grown in their garden, depending on the average climate of that region. For example, the state of Utah spans zones 9 through 4, with the southern city of Saint George within the warmer 9 and 8 growing zones, while Salt Lake City is within the 7 and 6 growing zones, and the higher elevation and cooler and drier cities like Vernal and Heber being within the 5 and 4 growing zones. Each zone is demarcated by the average annual minimum winter temperature, divided into 10-degree zones. Unlike the Köppen-Geiger climate classification system, the USDA Plant Hardiness Zone Map is based only on temperature, rather than a combination of temperature and moisture. Both maps and classifications must be updated as each region’s climate changes over time. Furthermore, both classification systems are based on the climate, rather than the occurrence of plants and animals. Other classifications have used the types of soils found in each region to demarcate each biome based on the soil type found in the area. These of course only describe the major biomes of Earth’s terrestrial ecosystems, leaving out the various ecosystems of the Earth’s oceans, which are related to other physical conditions such as salinity, water temperature, light and water depth. These biomes describe the physical abiotic environment and don’t define them on the occurrence of plants or animals as part of their definitions. For example, such systems would not recognize altered environments or biomes, such as agricultural lands and urban city centers that have been heavily altered by human intervention, yet may have similar climatic conditions as naturally preserved lands that are protected. Beginning in the 1970s the botanist David Goodall lead a team of biologists, ecologists, conservationists and land managers to summarize the major biomes on planet Earth in a multivolume book series, entitled Ecosystems of the World. They defined 30 major biomes on Earth, including biomes rarely defined in other systems or classifications, for example subterranean biomes like those found in caves. The Goodall’s classification also divided the Earth into natural biomes from those of human or managed biomes, such as field crops, managed grasslands and industrial urban landscapes. Hence two theories emerge on how to classify the major regions of Earth into biomes, one that is based on the occurrence of living organisms and one relies on the physical climate.

Support for the inclusion of specific biological species in the biome classification system comes from the central idea of keystone species. Keystone species are biological species within an environment that disproportionately affect a large number of other species in the same environment, and their removal from the region would completely alter the entire ecosystem drastically. A keystone species is sometimes not the most abundant, but one that influences the ecosystem the most and helps to maintain it. For example, many apex predators like wolves and lions are often considered a keystone species, because they have a significantly large influence on the occurrence of prey, as well as the plants that those prey animals might depend on.

Although many biomes are simply defined by the basis of the most abundant species, or the species with the largest amount of biomass in the environment. Biomass is the total mass of a particular species of organisms in a given area or volume. For example, the grassland biomes are defined by the large amount of grass plants that live within the region, while conifer forest biomes are defined by the large amount of biomass of conifer and pine trees. Hence biomes can be defined based on the most abundant and common of the biological organisms within a particular region on Earth.

The Major Biomes of Earth
There are many ways in which the Earth has been divided into major biomes. This list is not comprehensive, but includes most of the major biomes that are widely distributed on Earth, and easily recognized by the occurrence of species and climatic and physical conditions found within them.

Tundra Biome
The tundra biome occurs at high latitudes near the north and south pole, and represents cold regions on Earth, which are also some of the driest regions on Earth. In these regions the soils are frozen throughout the year as permafrost, with only a thin melt during the height of the summer. These soils are very ancient with only minor yearly growth of lichens and other arctic plants. The very short growing season and low light levels during the winter result in low species richness. The landscape is dominated by lichens and mosses, with grasses and other low laying plants adapted to the cold. Many migratory animals live in these regions of Earth including birds and caribou, as well as polar bears, that often move great distances across the landscape.

Boreal Forest Biome
The great taiga or boreal forests span much the upper latitudes of Canada and Russia. The boreal forest is dominated by cold winters and short growing seasons, with a forest of mostly coniferous trees, which remain green through the long winters. Conifers are a group of trees (gymnosperms) that evolved early in Earth’s history, bearing cones and wind-blown pollen, rather than bearing flowers and fruit. They are perfectly adapted to these seasonally cold regions of Earth, allowing their wind-blown pollen and cone bearing seeds to germinate in the cooler climates. The region contains many mammals, such as wolves, foxes, rabbits, moose, deer, and bison, but fewer reptiles like lizards, snakes and crocodiles, due to the cold climate.

Alpine Biome
The alpine biome is sometimes included in the boreal and tundra biomes depending on the elevation of the landscape. These are topographically high regions on Earth that are also seasonally cold, due to their high elevation. Increasing altitude on Earth decreases the average yearly temperatures, resulting in a similar profile as observed with the higher latitude tundra and boreal biomes. Alpine biomes are unique in that they are isolated on these alpine peaks and plateaus, and while having a similar climate to tundra and boreal regions of Earth they are unique in their isolation. Some alpine biome regions like the Himalayan Plateau are fairly extensive. One important aspect of the alpine biome is called the tree line. The tree line or timberline is the upper boundary of forests on a mountain peak, above which trees are unable to survive. This elevation varies between 10,000 feet (3.0 Km) to 12,000 feet (3.7 Km) above sea level across the United States, and depends on the amount of moisture and annual temperatures, but the tree line can be much lower in elevation the closer one travels toward the poles (higher latitude) as the climate becomes colder in these regions. These mountain top regions are often covered in ice and snow, both as semi-permanent glaciers as well as winter snow and ice that remains long into the summer months.

Temperate Rain Forest Biome
Temperate rain forests are found in the pacific northwestern coast of North America and South Eastern Australia, which are characterized by higher levels of moisture along these coastal regions. They often are filled with large evergreen trees including some of the largest trees that grow on Earth today. The heavy rain, and somewhat milder climate results in a lush forest landscape and hosts many plants that need high levels of moisture to survive including ferns and horsetails. They also host many epiphytes. These are plants that live on other plants like orchids, vines, ferns and moss. These biomes have a high diversity of amphibians, as well mammals and birds when compared to colder and drier biomes. These biomes are a major source of lumber, and affected by industrial forestry.

Temperate Deciduous Forest Biome
This biome includes large regions of the eastern United States, most of northern Europe, and Eastern China, where the climate alternates between mild winters and warm summers, with a fair amount of rain and snow. Temperate deciduous forests are characterized by trees that have adapted to the seasonal changes by losing their leaves in the fall, and re-growing them each year during the spring. This prevents the branches from breaking with the weight of snow in the winter months, but also allowing a greater surface area for photosynthesis in the warmer summer months. These forests are dominated by maple, oak, birch, and elm trees supported by rich soils. These regions are often cleared for farms and agriculture and host major urban centers because of the biological productivity of the soils for growing crops. Temperate deciduous forest are likely more dominate in Earth’s past, but have changed their distribution as the Earth has undergone various glacial and interglacial periods during the last several ice ages.

Tropical Rain Forest Biome
Tropical rain forest biomes are the most species rich biomes on Earth, and exhibit an enormous amount of different species of both plants and animals. This is a result of the lack of seasons, and the continued large amounts of rainfall. Tropical rain forests occur on land below the atmospheric Intertropical Convergence Zone (ITCZ), in which rain nearly continuously falls due to the atmospheric circulation and low pressure as a result of the equatorial position of these forests. This stable warm and wet climate allows trees to remain green throughout the year, and grow much more slowly. This also means that the forest is not shedding significantly large amounts of biomass onto the forest floor like in temperate deciduous forest, and the soils are organically poor, often sandy and leached of nutrients by the abundance of rain. Tropical rain forests support a tall forest canopy that is enclosed year-round, making the forest floor particularly dark. Closed forest canopies prevent sunlight from reaching the forest floor, while open forest canopies, where the trees are more widespread allow more sunlight to reach the forest floor. In close canopy tropical rainforests, sunlight is the limiting resource for plants. Tropical rainforests exhibit poor soils, and when cleared for agriculture often lead to muddy or sandy barren regions of dirt, since the soil is lacking organic carbon molecules and nutrients for plants to re-establish themselves. The rapid deforestation of rain forests has led to significant changes to these biomes, including the occurrence of forest fires. Forest fires in tropical rainforests result when famers and industrial agricultural agents clear the land. The cut wood is stacked and dried, and often set on fire to remove from it, but even if the wood is harvested or clear cut from the forest and removed by trucks, and the waste of wood shavings, chips, branches, twigs and saw dust is burned in large piles. These fires can set the surrounding virgin forest on fire, especially when they blow into these parts of the forest. Over the last decade there has been significant destruction of the tropical rainforest biome. In August of 2019 an estimated 3,500 square miles, or 9,060 square kilometers of the Amazon forest burned in fires across Brazil, Paraguay and Bolivia.

Tropical Deciduous Forest Biome
Tropical deciduous forests are characterized by seasonal wet and dry seasons, within warmer or tropical climates. These are sometimes referred as monsoon forests, as they are influenced by changes in the amount of rainfall. The forests across India, as well as Southeastern Asia, and parts of South America and Africa are greatly influenced by these cycles of rain. These regions rarely if ever see snow, as their temperatures remain warm throughout the year. A result of the monsoon cycle is that the soils often are red in color, due to the oxidation of iron, and tend to be less rich in nutrients than temperature deciduous forests because of leaching. Trees go dominate during the dry seasons and have a specific growing season.

Grassland Biome
Grasslands are broad regions of prairie or grassland steppes that lack significant numbers of trees due to the lack of water. They often have temperate climates, with cold winters and warm summers, and host a wide diversity of grass plants and other low laying scrubs. Grasslands undergo intense growing seasons in the summer, and fall dominate in the colder winters, leading to rich soils, despite the lack of trees. Grasslands host large mammals that feed on the grass covered landscape, including bison and prong horn antelope here in North America, but also have abundant insect and rodent populations, as well as snakes and lizards. Much of the world’s grassland biomes has been replaced by either grazing land or agricultural farms for the growth of wheat and corn. A few protected areas remain, established after the Dust Bowl years in the 1930s, the United State Government established national grasslands although much of this land is open to be leased for cattle, but are protected from agriculture to help maintain the soil.

Grazing Land Biome
Land that hosts large numbers of cattle, sheep, goats and horses for grazing is this biome, which incorporates aspects of grassland, savanna and desert biomes, but could include cleared forest land. Much of the grazing land biome is privately owned as small fenced fields to large ranches, but also includes government managed land that is leased to ranchers for access to grazing. Both cattle and sheep have been introduced to these areas, where they are raised for their skins and wool, as well as for their meat around the world. Grazing land depends on a rich source of grass vegetation, and often cultivate invasive species of plants such alfalfa or lucerne (Medicago sativa), cheat grass (Bromus tectorum) and knapweed (Centaurea diffusa).

Agricultural Biome
The agricultural is the biome of farms and irrigated lands that grow any type of crop. Often these are in regions that have a source of water that can be used on the crops to increase the growth. They typically have very low species richness and biodiversity of any biome because of the heavy use of pesticides and other deterrents for pests that might eat the crops. Corn, wheat, rice, and hay are the major crops on agricultural lands, incorporating various climates from wet rice paddies to dry wheat or alfalfa fields. Agricultural land covers much of the habitable terrestrial land on Earth, and relies on healthy soils and sources of water for the continued growth of food. It can host various mammals and birds, but often has limited biodiversity in plant life, which is found on the periphery of the biome.

Savanna Biome
Savannas are a mix of grassland and forest, which are composed of a scattered distribution of trees. They tend to have high temperatures, and more drier climates, with very seasonal rainy seasons. Savanna biomes are found across the African Sahel in northern Africa, and extending into Southern Africa, both places where precipitation is much lower than the more tropical equatorial regions. Savannas are biologically diverse, supporting large herds of mammals, and host animals from elephants, lions, zebras, antelope and wildebeests.

Chaparral Biome
Chaparrals are very dry biomes that support low scrubby evergreen bushes, and short drought-resistant trees. They are found in Southern California, parts of Arizonia, as well as around the Mediterranean Sea and Middle East and parts of Australia. A result of the vulnerably to frequent droughts, the chaparral biome is affected by frequent wild fires. Plants also tend to have large root structures that can tap into sources of water deep underground, and re-establish themselves after fires.

Desert Biome
Deserts are regions with low-precipitation and temperate to extremely hot climates. As arid environments, deserts have less total biomass, and depend on infrequent rain or snow. Plants are often adapted to the low availability of water, with some deserts nearly lacking plants altogether, with the landscape covered by blowing sand dunes. Many types of deserts exist, in Utah, the desert is a continental interior desert, in that low precipitation is due to the rain shadow of the more coastal mountain ranges in Nevada and California, which prevents significant rain compared to the coasts. Located within the center of the continent, these regions exhibit more extreme warm or hot summers, without the heat sink of the ocean. Deserts are found along the narrow strip of land between 30 to 40 degrees latitude, which due to the Hadley Cell atmospheric circulation pattern are under high pressure most of the time, and tend to exhibit dry air descending at these latitudes. This push of high pressure across these regions on Earth leads to air with low humidity and is undersaturated in respect to the availability of water. As the Earth warms the extent of Earth’s desert biomes is expect to expand poleward, as the atmosphere increases in temperature, leading to increased risk of drought in higher latitudes.

Cave Biome
Cave biomes are the unique life that lives underground in caves. Exhibiting a low species richness and diversity, caves offer a unique biome for life to live outside of the light, and utilized the cave temporarily as shelter. Cave biomes are interesting places to study the unique microscopic and bacterial life forms that are able to live in a biome without light. They often utilize sources of nutrients brought into caves, from such creatures as bats and small mammals that seek them out for shelter.

Urban Biome
The urban biome is likely the one that you are most familiar with since it encapsulates much of the landscape within city and town centers where most people live. This biome includes roads, parks, gardens, golf-courses, parking lots, homes, shopping centers, and warehouses. It is dominated by cultivated plants interspersed with asphalt roads and concrete sidewalks, with structures and buildings. They tend to have a higher biodiversity than agriculture lands due to the cultivation of a wider range of plant species, but like agricultural lands often relies on irrigation. The urban biome is home to many domesticated animals, such as cats and dogs, as well as humans, but also are frequented by raccoons, rats, and mice. The urban biome is rapidly expanding as new housing developments are built, which often grow out into the surrounding biomes. Urban biomes have high levels of plastic waste and other types of human refuse.

Freshwater River and Creek Biome
Rivers, streams and creeks and flowing freshwater on Earth are an important biome for both aquatic fish and insects, as well as the animals and plants that use these as sources of water. Flowing freshwater is an important source of well oxygenated waters that are utilized as spawning grounds for migratory fish. Large standing water bodies of water are prone to lose oxygen, especially in warm climates, and the flowing nature of freshwater rivers and streams provide an important biome for fish and the animals that depend them for food. Rivers provide a biome that is complex, as these ribbons of water move across different climates and elevations offering a path toward the interior of continents for aquatic life, as well as plants and animals that need access to water. The study of the freshwater river biome or ecosystem is called limnology.

Freshwater Lake and Pond Biome
Freshwater lakes and ponds are equally important biome of the freshwater system and interconnect rivers and streams. Lakes and ponds are biologically rich areas for supporting both aquatic animals and plants, as well as animals and plants that depend on them as a source of water. Many plants live in the shallow littoral zone on the edge of lakes including cattails, horsetails, and reeds. These regions are important for migrating birds, such as ducks and other waterfowl. Just like the ocean, lakes can become stratified, and can lose oxygen through eutrophication. Such events result in the death of fish and other animals that rely on well oxygenated waters. These events mark episodes of major disturbances to the biome, which can also occur during droughts as water levels drop, decreasing the extent of the biome.

Wetlands, Swamps and Marshes Biome
Wetlands are broadly defined as any land that is wet or covered by water during any part of the annual season. Mostly they are found in low poorly drained basins, where water will accumulate during rainy seasons. The amount of water and its depth various, but this more ephemeral source of water is important for amphibian, crocodilians and snakes, as well as birds and mammals. Trees often grow within these damp biomes, such as bald cypress (Taxodium distichum), that can live in standing water found in swamps in the southeastern United States. Many wetlands have been drained for use of the water, and various governmental agencies have worked hard to protect this biome.

Estuaries, Deltas and Tidal Flats Biome
This is a transitional environment between the ocean and land, and connects rivers and freshwater sources of water with saline ocean waters. This produces a biome similar to swamps and marshes, but with the water having a mix of salinity. These biomes are influenced by the daily and monthly tides, as well as longer term rise and fall of sea levels, which can flood regions along the coast. These regions are held together often by mangrove forests, which help trap sediment and nutrients, but can tolerate the salty water. Many invertebrate animals make use of the tides and water by burrowing into the muddy substrate, and filter feeding as the water moves in and out during the tidal cycles. Bivalves (such as clams and mussels) and barnacles as well as bryozoans, often encrust the rocks and wood to filter out food from the water. They are important biomes for birds, crocodilians, turtles as well as fish.

Coastal Lines and Beaches Biome
Beaches are also referred to as the littoral zone of the ocean, as it includes both the sandy coastline as well as the shallow near shore. The breaking of waves, and everchanging tides make beaches an interesting biome for animals and plants. Kelp (or seaweed) of the brown algae class Phaeophyceae, grows in the water, buoyed up by air sacs that help keep the kelp floating within the photic zone. Echinoderms, such as starfish and sea cucumbers lives in this zone, as well as gastropods (snails). Other mollusks such as bivalves dig down into the sandy substrate to filter feed from the passing water. The high energy of the beach coast line and crashing waves, make this region a seemly constantly changing environment, but it is rather stable over time when compared other biomes.

Open Ocean (Pelagic zones) Biome
This is the open ocean biome of swimming and floating plants and animals. The pelagic zone is divided into the photic zone near the surface, and the deeper aphotic zone below, which is dark. Animals live within this zone by freely swimming (like fish, sharks, and marine mammals and various invertebrates (like shrimp and cuttlefish), and those animals that float in the water (jellyfish, plankton, such as tiny dinoflagellates, diatoms, and foraminifera). The Open Ocean Biome is the largest biome on Earth and covers the most volume on Earth. This large volume is because the open ocean or pelagic zone includes a wide range of depth within the ocean waters. This biome is also the least visited by humans, and remains poorly understood given the challenges of studying these ocean creatures.

Ocean Floor (Benthic zones) Biome
The finally biome is the ocean floor, the animals that live by crawling around or sessile (attached to the ocean floor). The benthic zone covers about 70% of Earth, and host a wide variety of biomes, from near shore coral reefs, lagoons, to deep abyssal and hadal zones in the deepest and darkest parts of the Earth. The ocean floor is a unique biome because it depends heavily on the input for organic nutrients from the pelagic zone above, and much of the ocean floor lacks access to sunlight for energy. Most of the organisms that live on the ocean floor utilize the organic waste that rains down, making most of these organisms scavengers or decomposers with them utilizing chemosynthesis.

Measuring Biodiversity
Biodiversity today is often defined by the total variety and variability of life on Earth. It is often used in discussions of its importance for the preservation and protection of key biomes on Earth that support the many biological species. In measuring biodiversity ecologists define two indexes that can be used to compare biomes or regions. The first is richness.

Species richness
Species richness is simply the number of species that have been documented in a certain region or area, while family richness is defined more broadly as the number of families or closely related groups of species in a region or area. Species richness is determined by counting the number of different species within a geographic region, from a single country, or county to a broader ecosystem or biome. The various biomes on Earth have varying degrees of species richness. Tropical rain forest biomes of the Amazon and Congo Rainforests contain very high species richness, with nearly 20,000 species of vertebrates in these areas, while tundra and boreal forests biomes near the poles have low species richness with about 1,000 or less species of vertebrates. The cold and open tundra biome contains less resources for food and shelter, and a harsh environment for biological species. The complexity of the tropical forest environment and uniform climate allows for numerous environmental resources and a stable environment to live in. Species richness is correlates to latitude, with low latitude, equatorial regions having high species richness, while high latitude polar regions having low species richness. Moisture, and the average annual rainfall also effects species richness, but less than the variability of the season temperatures. In the ocean’s warm coral reefs, lagoons and estuaries all exhibit high species richness, while dark cold deep ocean water and regions with high salinity exhibit low species richness, due to limitation of resources within these regions of Earth.

One observation is that animals that live near the poles at high latitudes tend to be larger than animals that live near the equator. This is referred to as Bergman’s rule, named after Carl Bergman, a German a professor of anatomy and physiology in the mid-1800s. One explanation for this pattern is physiological, animals that live in colder climates will be larger to maintain body temperature during colder months of the year (low surface to body ratio), while warmer climates will favor smaller animals that are able to disperse heat more effectively with high surface to body ratios. This applies only to endothermic animals, like mammals and birds.

Determining species richness requires numerous surveys in which each organism is identified to its unique species. This is in practice is difficult to accomplish, although various government agencies have supported such efforts, often relying on the volunteer work of experts in various groups of organisms, from botanist, entomologists, herpetologist, ornithologists, and mammologists, each identifying the species in a given area. Species richness relies on a statistical process called rarefication. For example, each time you visit an area there may be different numbers of species present and observed. Rarefication is the continued sampling of individual organisms and measuring the likelihood of a new and novel species being counted. It looks at the curve of the increasing number of species, and how likely a new species will be encountered on a subsequent visit to the area. This is important, because many species are rare or only visit the region at certain times of the year. Another challenge in studying species richness is that many species, such as microscopic life, are often overlooked in such surveys. It is likely that many biomes are much richer in biological species than currently understood.

Biological diversity
Biological diversity is a measure of the representative abundances of each species in an environment. A biological diverse environment will have more species, but also a more evenly distributed abundance of these species in that environment. One of the measurements to determine biological diversity is the Shannon-Wiener index.
 * $$ H' = -\sum_{i=1}^R p_i \ln p_i $$

Let us use a simple example of two groups and compare their Shannon-Wiener index using this formula above. One environment contains the following species: Here we have 5 species represented by 34 individuals. First, we calculate the proportion of each species by dividing the number of individuals of that species with the total number to get proportions, for example Species A has 25 individuals out of 34, so it represents a proportion of 73.5% in the environment, while Species A with a single individual only represents 1.03% of the individuals. We take the natural log of each of these proportions, multiple them by the proportions, and total them up, divide by the number of species to get a mean and take the negative of the resulting index. So, for this first group the Shannon-Wiener index diversity is 0.185. Let us look at a second group.
 * Survey One
 * Species A = 25 individuals
 * Species B = 3 individuals
 * Species C = 1 individuals
 * Species D = 2 individuals
 * Species E = 3 individuals
 * Survey Two
 * Species A = 3 individuals
 * Species B = 3 individuals
 * Species C = 3 individuals
 * Species D = 3 individuals
 * Species E = 3 individuals

Notice in this group has 5 species, so the species richness is the same between these two groups, but now we have only 15 individuals, but each of those have similar proportions of 3. We take the proportion of each of these species, which are all 32% and take the natural log, and multiply the result by the proportion, and take the mean by dividing the total by 5, then take the negative. In this cause the resulting index is higher 0.322. That is because there is a more equal proportion of each species abundance to each other. We can say that the first group is less diverse than the second group, despite the fact that there are more individuals in the first group. Such measures of biodiversity are very important because a single species can come to dominate a region, this is particularly an issue with invading species and in particular agricultural and grazing lands where plants or animals of a certain type predominate at the expense of other species. This process results in very low biodiversity in these regions, and often is reflected in species richness numbers as well.

One of the central issues in the study of biodiversity is understanding the mechanisms for promoting a biological diverse ecosystem and maintaining it. Both ecological and paleoecologically studies suggest two major factors come into play in maintaining a biological diverse biome. First is a stable physical environment, with a climate remaining seasonally stable for long periods of time, and second that the environment is left undisturbed, avoiding short term events such forest fires, asteroid impacts, urban and industrial development and other short-term calamities that result in an alteration to the landscape. One aspect of disturbing a landscape is the introduction of a rapidly reproducing invasive species, which can take over a region and dominate the biodiversity of the area. But most disturbances to the landscape are done by humans directly, from building a road, to plowing a field.

Ecological Succession
Ecological succession is the process under which biological communities of plants and animals recover from a major disturbance. These disturbances can be natural, like landslides, volcanic eruptions, or wildfires, or be human induced such as clearing a forest for agriculture, mining, or industrialization of the landscape such as oil and gas drilling, building a parking lot or road and driving across the land. All these disturbances leave behind major altered biological communities, often with highly reduced species richness and biodiversity than before the disturbance. Ecologists study how long an area recovers from a particular disturbance. Ecologist begin by defining a Climax Community. A climax community is a stable community that is self-perpetuating and in equilibrium with the physical habitat of the area, with high levels of species richness and biodiversity, with low to no decline of species occurrences within the area. A climax community can be regarded as a stable community with high biodiversity, that would have existed prior to the disturbance. Early naturalists, like Henry David Thoreau wrote about the succession of forest trees from farms that had been cleared, but subsequently left fallow, and were eventually replaced by trees that reclaimed the farm field after numerous years had passed. One of the key scientists in the study of ecological succession, who also helped coined the term ecology, was Henry Chandler Cowles. In the late 1800 he studied areas that were covered by wind-blown sand dunes and studied how plants re-established themselves over the course of multiple years. Volcanic eruptions and intense wild fires have also proven interesting case studies to understand the succession of plants following the recovery of disturbance.

The idea of ecological succession governs much of land management practices, particularly in the United States where land disturbance is widely regarded as transitory and temporary, and given enough time, the area will recover to its pre-disturbance state. However, land disturbance by human activities often are not a rare occurrence, but frequent, cyclic and cumulative over time, limiting the full recovery. Often a prior climax community may be unknown, as the area may historically have been over grazed and clear cut to begin with. With frequent ground disturbances over hundreds of years, the original species richness and biodiversity of the area may not have been recorded prior to the initiation of these disturbances. Disturbed areas are susceptible to invasive species of both plants and animals, often which take a foothold into the area and alter the area differently than prior to the disturbance. Land managers may alter the environment on a continued basis, such the massive removal of juniper and pinyon trees across Utah to provide grazing land for cattle on public lands or efforts to start controlled burns to prevent major wildfires that might destroy economical valuable structures. Reseeding programs, where disturbed lands from mining and oil and gas drilling on public lands are re-seeded lead to different replacement vegetation, as those that existed prior to the ground disturbances. Contamination of ground water, or the draining of ponds and lakes for use on crops, can lead to long term changes to the land, altering the availability of water making a succession toward a climax community not likely. Furthermore, a consequence of a changing climate over time, and the long-term process of ecological succession, means that prior climax communities existed under a cooler wetter climate, and these plants and animals can no longer be established in the area because of climate change. In truth, the concept of Earth’s biomes is in flux, and changing, with examples of natural biomes becoming limited to protected lands on national parks, and a growing expanse of disturbed lands (such as Urban, Agricultural, and Grazing Biomes), within new sets of biome definitions.


text:
User talk:Burroughswl

=Welcome== Welcome to Wikibooks, Burroughswl!

 First steps tutorial Wikibooks is for collaborative development of free textbooks.

You do not need technical skills to contribute. You can easily change most books. Please introduce yourself, and let us know what interests you.

If you already contribute at other Wikimedia projects, our Wikimedia Orientation should quickly get you started. (Would you like to provide feedback on this message?)

  Getting help   Made a mistake?   Goodies, tips and tricks
 * Read the Using Wikibooks book for a friendly introduction to the project, or our help pages for more information.
 * You can get friendly help from the community in the user assistance room or our IRC channel.
 * Upload freely licensed files to Wikimedia Commons. You may request permission to upload fair use files locally. Please include author and source information and a non-free use rationale for non-free files.
 * You can restore a previously saved version.
 * Pages should follow the  naming convention.
 * Need to rename a page? Use the move tab (is available once your account is 4 days old - until then, ask for help).
 * To request a page be deleted, add to the top of the page.
 * Was a page you made deleted? Please read the deletion policy, and check the deletion log to find out why. Also check the RFD archives if applicable. You can request undeletion at WB:RFU, or ask the administrator who deleted the page.
 * Please fill in the edit summary and preview your edits before saving.
 * Sign your name on discussion pages by typing ~~~~
 * User scripts can make many tasks easier. Look at the Gadgets tab of my preferences; check off the boxes for the scripts you want, and hit save!

Jules (Mrjulesd) 07:24, 26 June 2020 (UTC)

title: User talk:Burroughswl


text:
User talk:184.91.55.159

JackPotte (discuss • contribs) 16:15, 26 June 2020 (UTC)

title: User talk:184.91.55.159


text:
Cognitive Science: An Introduction/Situated Cognition

=Situated Cognition= Situated cognition holds that cognitive processes are deeply influenced by context and the physical and cultural environment in which they are used. In this sense, situated knowledge results from the cultural activity in which the knowledge was developed and applied.

Rather than knowledge being considered the accumulation of factual units, situated learning is viewed as the improvement of performance across contextual situations. Relevant to this view of cognition and knowledge is the notion of “cognitive apprenticeship.” This idea holds that optimal learning occurs through mentorship in way that directs knowledge toward applicable situations. This is considered by many to be the main method by which humans evolved to learn, that is, a cultural transmission through direct personal mentorship.

Relation to Embodied Cognition
Cognitive processes that are situated are context-sensitive, vary with time, action-oriented, and embodied. The effectiveness of cognitive processes profoundly depend on the extent to which a individual interacts appropriately with their contextual, physical, and social settings. This view is closely related to those held by embodied cognition, in which aspects of cognition are interconnected with properties outside the brain. These processes are properly understood as being engaged in a physical or mental task that is contextually, physically, and/or culturally situated.

Embodied human and animal cognition is attuned to be responsive to feedback from the environment in which they pursue their goals. Shattuck and Miller (2006) wrote that “perceptual-motor feedback processes effectively relate animal cognition to the environment and action in a way that a mechanism based on logical (descriptive) inference alone does not capture.” This view holds that learning and expertise are only meaningful if viewed as the skillful application of knowledge in a situated environment.


text:
English-Hanzi/Vitamin A accumulates in the liver and may reach harmful levels

Vitamin A accumulates in the liver and may reach harmful levels sufficient to cause excess vitamin A.

维生素A在肝脏中积累，可能达到足以引起过量维生素A的有害水平.


text:
User talk:41.115.99.135

Welcome!
Hello, and welcome to Wikibooks! Thank you for your contributions so far. I hope you like the place and decide to stay.

You don't have to log in to read or edit articles on Wikibooks, but if you wish to acquire additional privileges, you can simply  [ create a named account] . It's free, requires no personal information, and lets you:
 * Create new pages and rename pages
 * Edit semi-protected pages
 * Upload images
 * Have your own watchlist, which shows when articles you are interested in have changed.

If you edit without using a named account, your (41.115.99.135) is used to identify you instead.

By the way, please make sure to sign and date your talk page comments with four tildes (~~~~).

Happy editing! Aranya (discuss • contribs) 19:22, 26 June 2020 (UTC)

title: User talk:41.115.99.135


text:
Free Knowledge Culture Calendar/August 3

 Phineas Fisher @GammaGroupPR · Aug 3 Here at Gamma International, we've run out of governments to sell to, so we're opening up sales to the general public! Today in 2014 Phineas Fisher hacked the german surveillance technology company Gamma Group and published source code, price lists and release notes. With support from the german government, Gamma produced and marketed the spyware FinFisher, which was used by governments around the world against political opposition. Customers were governments of more than 30 countries, including Bahrain, Egypt, Ethiopia, Germany, Uganda and the United States. Fisher published a series of educational posts on her methods.


text:
Free Knowledge Culture Calendar/June 27

Today in 1997 ECMAScript was standardized. It brought a unifying standard after Borland and Microsoft had already forked off their own dialects of the Web scripting language JavaScript, which Netscape had introduced in 1995. It became the most widely used programming language and the Web the most common computing platform. After overcoming another divide, namely Microsoft’s JScript, the rise of Ajax web applications gave a big boost in popularity starting in 2005, and finally the immensely popular Node.js runtime brought substantial usage outside of web browsers.

title: Free Knowledge Culture Calendar/June 27


text:
English-Hanzi/Vitamin D is a group of fat-soluble steroids

Vitamin D is a group of fat-soluble steroids, responsible for increasing the absorption of calcium, magnesium and phosphate in the intestine, and has a variety of other biological effects.

维生素D是一组脂溶性类固醇，负责增加肠道中钙，镁和磷酸盐的吸收，并具有多种其他生物学作用.


text:
English-Hanzi/Very few foods (such as oily fish) naturally contain large amounts of vitamin D

Very few foods (such as oily fish) naturally contain large amounts of vitamin D. In the United States and other countries, milk and vegetable milk substitutes are rich in vitamin D, as are many breakfast cereals. Mushrooms produce useful amounts of vitamin D when exposed to ultraviolet light.

很少有食物（如油性鱼）天然含有大量的维生素D. 在美国和其他国家，牛奶和植物奶替代品富含维生素D，许多早餐谷物也是如此. 蘑菇在暴露于紫外线下时会产生有用量的维生素D.


text:
User talk:Dmehus

Welcome
Welcome to Wikibooks, Dmehus!

 First steps tutorial Wikibooks is for collaborative development of free textbooks.

You do not need technical skills to contribute. You can easily change most books. Please introduce yourself, and let us know what interests you.

If you already contribute at other Wikimedia projects, our Wikimedia Orientation should quickly get you started. (Would you like to provide feedback on this message?)

  Getting help   Made a mistake?   Goodies, tips and tricks
 * Read the Using Wikibooks book for a friendly introduction to the project, or our help pages for more information.
 * You can get friendly help from the community in the user assistance room or our IRC channel.
 * Upload freely licensed files to Wikimedia Commons. You may request permission to upload fair use files locally. Please include author and source information and a non-free use rationale for non-free files.
 * You can restore a previously saved version.
 * Pages should follow the  naming convention.
 * Need to rename a page? Use the move tab (is available once your account is 4 days old - until then, ask for help).
 * To request a page be deleted, add to the top of the page.
 * Was a page you made deleted? Please read the deletion policy, and check the deletion log to find out why. Also check the RFD archives if applicable. You can request undeletion at WB:RFU, or ask the administrator who deleted the page.
 * Please fill in the edit summary and preview your edits before saving.
 * Sign your name on discussion pages by typing ~~~~
 * User scripts can make many tasks easier. Look at the Gadgets tab of my preferences; check off the boxes for the scripts you want, and hit save!

--Pi zero (discuss • contribs) 03:20, 27 June 2020 (UTC)

title: User talk:Dmehus


text: User:Dmehus/sandbox

title: User:Dmehus/sandbox


text: User talk:MrJaroslavić/preload

title: User talk:MrJaroslavić/preload


text:
User talk:MrJaroslavić

 Welcome!

To leave a message, please click the link below: [ Leave a new message]

title: User talk:MrJaroslavić


text:
English-Hanzi/Vitamin D overdose causes hypercalcemia

Vitamin D overdose causes hypercalcemia, which is a strong indication of vitamin D toxicity – this can be noted with an increase in urination and thirst. If hypercalcemia is not treated, it results in excess deposits of calcium in soft tissues and organs such as the kidneys, liver, and heart, resulting in pain and organ damage.

维生素D过量会引起高钙血症，这是维生素D毒性的有力指示-排尿和口渴的增加可引起注意. 如果不治疗高钙血症，则会导致钙在软组织和器官（如肾脏，肝脏和心脏）中过多沉积，从而导致疼痛和器官损害.


text:
Free Knowledge Culture Calendar/January 31

most of you steal your software. [...] Who cares if the people who worked on it get paid?

Bill Gates General Partner, Micro-Soft In 1976, today’s edition of the Homebrew Computer Club Newsletter published Bill Gates’ “Open Letter to Hobbyists”.


text:
Pascal Programming/Units

In original Standard Pascal all functionality of a program other than the standard functions Pascal already defines had to be defined in one file, the  source code file. While in the context of teaching the sources remained rather short, entire applications quickly become cluttered despite various comments structuring the text.

Quite soon different attempts to modularize programs emerged. The most notable implementation that remains in use till today is UCSD Pascal’s concept of units.

UCSD Pascal units
A UCSD Pascal unit is like a  except that it cannot run on its own, but is supposed to be used by  s. A   can define constants, types, variables and routines just like any , but there is no executable portion that can be run independently. Using a unit means that this unit becomes a part of the program; It is like copying the entire source code from the  to the , but not quite the same.

Usually, units are stored in separate files thus incredibly cleaning up the ’s source code file. However, this is not a set requirement, since after an  a module is considered complete and another module may follow.

Defining units
A  definition shows many similarities to a regular , but with many additional features.

Header
The first line of a  looks like this: Unlike a  there is no parameter list. A  is a self-contained unit of certain functionality, thus cannot be parameterized in any way.

This line also declares a new identifier, in this example. becomes the first component of the so-called fully-qualified identifier. More on that later.

Parts
The  concept provides means to encapsulate its definitions, so that the programmer using the   does not need to know how certain functionality is implemented. This is done by splitting the  into two parts: A programmer using another unit only needs to know how to use the unit: This is outlined in the  part. The programmer who is programming the unit on the other hand will need to implement the unit’s functionality in the  part. Thus a bare minimum unit looks like this: The  part has to come before the   part. Also note that s terminate with a   just as a   does.
 * 1) the   part, and
 * 2) the   part.

The  part of   consists of a block, except that it cannot contain any statements. The  is merely declaratory. All identifiers defined in the  part will become “public”, i. e. a programmer using the unit will have access to them. All identifiers defined in the  part, on the other hand, are “private”: they are only available within the unit’s own  part. There is no way to circumvent this separation of exported and “private” code.

Import
Now, it is great that we have finally outsourced some code, but the point of all of this is to use the outsourced code. For this, UCSD Pascal defines the  clause. A  clause instructs the compiler to import another unit’s code and familiarize with all identifiers declared in the   part of that unit. Thus, all identifiers from the unit’s  part become available, as if they were part of the module importing them via the   clause. Here is an example: Note, that the    neither defines nor declares the function , but nevertheless uses it. Since ’s signature is listed in the   part of , it is available for other modules using that module.

clauses are allowed in any module. Of course it is possible to use other units inside a. Moreover, you are allowed to have two  clauses in one , one in the   and one in   part each. The units listed in the  part’s   clause propagate, that means they become also to the module that uses such units.

Namespaces
Now, programming with units would have been a hassle if all units that were ever programmed had to explicitly define exclusive identifiers. But this is not the case. With the advent of modules all modules implicitly constitute a namespace. A namespace is a self-contained scope where only within identifiers need to be unique. You are quite welcome to define your own  and still use the   unit.

In order to distinguish between identifiers coming from various namespaces, identifiers can be qualified by prepending the namespace name to the identifier, separated by a dot. Thus,  unambiguously identifies the   function exported by the   unit. This notation is called fully-qualified identifier, or FQI for short.

Unit design
There are several considerations that should be accounted for:
 * Whenever some code might be useful for other programs too, you may want to create a separate unit.
 * One unit should provide all functionality necessary in order to be useful, however,
 * a unit should not provide features that are unrelated to its main purpose.
 * Your unit’s usability largely depends on well-defined interface. Requiring knowledge of the specific implementation is usually an indicator for bad code.

Run-time system
Some compilers use units for providing certain functionality that serves the gray zone between a compiler’s actual task and a  (i. e. what you write). Most notably, Delphi, the FPC as well as the GPC provide a run-time system (RTS) that includes all standard routines defined as part of the language (e. g.  and  ). In Delphi and the FPC this unit is called, whereas the GPC comes with the   unit. These units are sometimes referred to as run-time library, RTL for short.

Knowing what the RTS’s unit is called could be useful, since this implies that all identifiers of the RTL are part of one namespace. That means, in (for example) Delphi and the FP one may refer to the standard function  by both, its short name as well as the FQI. The latter may be required if you are shadowing the  function in the current scope, but need to use Pascal’s own   function.

Debugging
The FPC comes with a special unit  (heap trace). This unit provides a memory manager. It is used to find out whether the  does not release any memory blocks it earlier reserved for itself. Allocating memory and not handing it back to the OS is called “memory leaking” and is a very bad circumstance. Due to the  unit’s intrusive behavior into Pascal’s memory management, it also needs to be loaded very soon after the   unit has been loaded. Hence, FPC forbids you to explicitly include the  unit in the   clause, but provides the   compiler command-line switch that will ensure inclusion of that unit.

The  unit is only used at the development stage. It can print a memory report after the ’s final.

The  unit is somewhat easy to use, but also limited in its features. We recommend to use dedicated debugging and profiling tools such as  as knowing how to use such tools will serve you well if you ever switch programming languages. If you specify the  switch on  ’s invocation, the FPC will insert debugging information for usage with.

Other modularization implementations
The Extended Pascal standard lays out a specification for s. These provide advanced means of modularization. However, neither FPC nor Delphi support this, only the GPC does.

Tasks
Notes:

title: Pascal Programming/Units


text:
Web App Development with Google Apps Script/authentication

Why authenticate?
Quite often you'll want to protect your web app to ensure only certain people can use it. When you publish your page you have a few options in two major categories:
 * 1) Who has access (who can get to the page)?
 * 2) Just you
 * 3) Anyone in your domain (hamline.edu for me)
 * 4) Anyone
 * 5) Which account is being used to run the script?
 * 6) Yours (even when other people access)
 * 7) Theirs (won't work with "anyone" above)

Those are useful but they're a little coarse grained. Sometimes you'll want only certain people to either have access and/or be able to do certain things.

Who is accessing?
For this section we'll assume you've set "who has access" to "anyone in your domain." If you do then you can determine who is accessing like this:

Are they allowed?
Once you have the user's email, you can check it against a sheet in your spreadsheet that has allowed users and perhaps other information about them, like what things they're allowed to do. Let's assume you have a sheet that looks like this: Then we could authenticate the user like this: