text:
Zoph/Changelog

=Zoph 0.9.7= 20 jan 2018

I have had a very busy year and little time to spend on Zoph, but last December, I finally found time to finish what I had originally planned for 0.9.6: a complete rewrite of the search screen and the search engine. Most of the code in that part of Zoph was over 10 years old and had become quite messy over the years. The search engine is really the core of Zoph: if you open an album in Zoph, under the hood, Zoph really executes a search for all the photos in that album. This makes this code really important and I've made sure to cover all this by automated tests (UnitTests) before making any changes.

 * issue#83 Complete rewrite of the search page and the core functions of Zoph, including modernization of several other part of Zoph.
 * issue#90 Error displayed when adding a new place
 * issue#99 Geolocation doesn't work when using https
 * Documentation updates - not all files were correctly displayed using Github's Markdown interpreter

=Zoph 0.9.6= 14 apr 2017

Zoph 0.9.5 coincided with a significant change in MySQL, that caused a lot of bugs in Zoph and other open source projects. MySQL changed the way they process queries to handle them much more strictly. What makes things worse, is that MariaDB did not make this change, so at first I could not reproduce the issue. Because of the amount of work, I have decided to postpone the development that was planned for 0.9.6 and make this a bugfix-only release. In this release, I have included a few bugfixes by Pontus Fröding which is really great, thanks Pontus!

Bugs

 * issue#86 Fixed an omission in the upgrade instructions for 0.9.5
 * issue#87 error about class not found on add or edit
 * issue#88 Changes for MySQL 5.7 compatibility
 * Give timestamp a default value
 * Add field needed for MySQL 5.7 compatibility with SELECT DISTINCT .. ORDER BY
 * Adding "ORDER BY" fields to autocover query
 * More changes for MySQL 5.7 compatibility
 * Updated SQL scripts
 * Removed unused field from the database

 * issue#91 Changed PHPUnit classes to namespaced class naming
 * Fixed an issue in a UnitTest that caused a failed test commit

 * Pull request#94 Add namespace to template showJSwarning in edit_person (by Pontus Fröding)
 * Pull request#95 add template namespace on two more places. (by Pontus Fröding)
 * issue#92 Fixed database connection to utf-8
 * issue#93 Pull request#95 Fix for "Class pager not found" when using pagesets (by Pontus Fröding)

Refactor

 * Some modifications to backtrace printing, for easier debugging
 * Moved album view into template
 * issue#89 Changed look of next and previous buttons on photo page and increased size of actionlinks
 * Small style change

=Zoph 0.9.5= 4 feb 2017

Zoph 0.9.5 is the new stable release. It is recommended for everyone to upgrade to this release

Features

 * issue#68 Changed from Mapstraction to Leaflet as mapping abstraction - with GoogleMaps, OpenStreetMap and MapBox (OpenStreetMap) support The code for this was based on code provided by Jason (@JiCiT)
 * issue#80 You can now edit permissions from the album screen, without the need to go to the group edit.
 * issue#82 Zoph now gives a proper error message if a photo can not be found

Bugs

 * Fixed a bug where in some cases it was possible for an admin to unintentionally delete albums

Refactor

 * Lots of internal changes to move to an MVC-architecture
 * Several more parts of Zoph moved into templates
 * Added more unittests - to automatically test Zoph

=Zoph 0.9.4= 18 Sept 2016

Zoph 0.9.4 is the new stable release. It is recommended for everyone to upgrade to this release

Features

 * Geocoding: Zoph now also searches Wikipedia
 * issue#67 Changed the colour scheme definition to use a nice interface to select the colour
 * issue#23 An admin user can now define default prefences for new users
 * issue#24 Added an option to automatically propagate permissions to newly created albums
 * issue#78 Removed Yahoo, Cloudmade mapping as they no longer offer their services to the public
 * issue#78 Removed Openlayers mapping, as Zophs implementation was buggy and did not work anymore.
 * issue#47 Photos can now be deleted from disk (moved to a trash dir)
 * issue#67 Added some new colour schemes

Bugs

 * Fixed an issue with album pulldown when editing group access rights
 * Fixed an issue where the circles page would sometimes report $title not found
 * Fixed an issue with changing views on circle page
 * Fixed an issue that caused errors in Firefox when using the configuration page
 * fixed collapsable details for time and rating
 * issue#78 Fixed a case where an admin user was sometimes not allowed to see a person or a place

Other improvements

 * issue#77 Lots of fixes in the German translation by Thomas Weiland
 * Moved group display to template
 * Moved group delete (confirm) into template
 * Moved group edit to a template
 * issue#79 Modify recursive creation of directories, so Zoph can function in an open_basedir environment.
 * issue#66 Cleanup of CSS
 * Some modernization of the looks of Zoph
 * issue#85 Modified import process to show clearer error message
 * Added a reset CSS
 * issue#81 Documentation updates
 * Some fixes for UnitTests
 * Additional tests
 * Refactor of group_permissions class into permissions class
 * Refactor prefs class
 * Moved preferences page to template
 * Modified prefs template to use labels instead of definition lists

=Zoph 0.9.3= 10 jun 2016

Zoph 0.9.3 is the new stable release. It is recommended for everyone to upgrade to this release

Features

 * issue#72 Zoph now has a new logon screen The logon screen has background photos. Two of them are already included in Zoph. You can place your own backgrounds in templates/default/images/backgrounds/. Or, you can (on the config screen) define an album from which the images will be used as background images. Zoph will display a random image as background.
 * issue#76 The logon screen now gives a message about the username and/or password being wrong instead of just returning to the same screen
 * issue#75 Zoph now uses PHP's password hashing algorithm instead of MySQL's. This includes a random 'salt' added to each password. This will make it much, much harder to decrypt your passwords, if your database would ever fall into the wrong hands. The old hashes will be updated with the new ones as soon the user logs in. Zoph will continue to support the old password hashes at least until v0.9.5.
 * issue#26 It is now possible to define the cookie expirement time. In previous versions of Zoph, a user would be logged out when closing the browser. Is now possible to extend the time to 1 hour, 4 hours, 8 hours, 1 day, 1 week or 1 month. This means a user will not need to re-login for that period of time, even when the browser is closed in the mean time. This can be very convenient, but it could mean that a user leaves Zoph logged in on a public PC. Therefore, the default is still 'session', which means a user will be logged out when closing the browser.
 * "new" pages now show up in breadcrumbs
 * It is now possible to give a user "can see all photos" access rights. This means you can give a user access to all photos, without giving him/her admin rights and without having to update user rights whenever an album is added.
 * issue#22 It is now possible to allow a user to create albums, categories, people, circles and places. The user automatically has access rights to place photos in the albums, categories, people, circles and places he or she has created.
 * issue#21It is now possible to allow a user to delete photos. The user will have to have "write" access to at least one album a photo is in.
 * Remove the rather ugly trailing space on the links on zoph.php

Bugs

 * issue#73 Fixed sharing feature
 * issue#74 Fixed Canadian English, Dutch and German translation files

Other improvements

 * Added a way to disable a setting on the configuration page depending on the state of another configuration item. (This was created because the photo album as a logon background relies on the sharing feature to be enabled).
 * Moved user page to template
 * Moved form into a separate class
 * Some cleanup of the places and categories pages
 * Refactor HTML for actionlinks
 * Modified createTestData script to only require password once
 * Rearranged order of unittests
 * Added translations for German, Canadian English and Dutch

=Zoph 0.9.2= 1 apr 2016

Zoph 0.9.2 is the new stable release. I have decided to drop the separation between 'stable' and 'unstable' or 'feature' releases. This means that it is recommended for everyone to upgrade to this release.

Features

 * issue#44 Added 'circles': a way to group people in Zoph. This is especially handy if you have a large amount of people in your Zoph, and the 'person' page is becoming confusing or cluttered.
 * issue#46 A circle and it's members can be supressed in the overview page, so you can, for example, hide people that you added only for a small set of photos.
 * issue#20 Zoph has switched to the PDO classes for database access. This ensures compatibility with PHP in the future, because the old mysql libs will be dropped soon.
 * issue#32 It is now possible to set more properties of a photo, including map zoom from the web import.
 * issue#60 The link text for "next" and "previous" as well as page numbers has been increased in size for better usability esp. on mobile devices
 * Added a script for fixing filename case (by Jason Taylor)
 * Access Google maps via https (Jason Taylor)
 * As of this version, the language files are in the php dir, and no longer need to be copied or moved separately

Bugs

 * issue#49 Zoph now supports MySQL strict mode
 * issue#55 Autocomplete not working for people
 * issue#58 Sort order for albums and categories can not be changed
 * CLI: Fixed an issue where Zoph would try to import to the current directory when double spaces were present in CLI
 * Better handling of file not found problems during import
 * Fixed two bugs that caused maps not to display
 * Fixed an issue where breadcrumbs wouldn't be removed correctly in some cases
 * Changed erronous extension of Exception class
 * Fixed slow login times for non-admin users
 * Improved performance on people page
 * Fixed: zoom buttons are missing from Google Maps
 * Remove duplicate files from import (if you would specify the same file twice on CLI import, you would get an error, this is now filtered out)
 * Fixed an issue where the person pulldown on the add user page appeared to be empty
 * Remove a user from a group when a the user is deleted
 * Fixed a warning about unknown variable on places page
 * Allow apostrophes in place names when creating map markers (Jason Taylor)

Refactor

 * A complete new query builder has been created
 * Many more parts of Zoph can be (and are being) tested automatically now, this should improve overall quality and reduce bugs
 * Many parts of Zoph have been cleaned up to modernize code to the current state of PHP - dropping PHP 5.3 and 5.4 compatibility
 * Dropped MSIE6/7 compatibility
 * Added documentation to many parts of Zoph's source code
 * Many changes to readability of source code, such as more consistent use of whitespace
 * Added some more debugging possibilities to easier troubleshoot in case of problems
 * Changed logging so less logging is displayed when set to log::NONE
 * Changed all self:: references into static:: references
 * Added function scope to many methods
 * Started using namespaces to better organize the classes
 * Updated version numbers in REQUIREMENTS readme.
 * issue#8 (partial) Changed several parts of Zoph to use templates
 * Added improvements to templating system
 * Modified query for photo access rights to a view for performance reasons
 * Changed logging so SQL query log to file can be done without displaying
 * Performance improvement on place page
 * Added a posibility to debug queries including parameters

=Zoph 0.9.1= 21 feb 2014

Zoph 0.9.1 is the first feature release for Zoph 0.9, it shows a preview of some of the new features for Zoph 0.10. Most important change is the move of most configuration items from config.inc.php into the Web GUI.

Features

 * issue#28 Configuration through webinterface commit (jeroenrnl)
 * Removed display desc under thumbnail feature commit (jeroenrnl)
 * Removed MIXED_THUMBNAILS and THUMB_EXTENSION settings commit (jeroenrnl)
 * removed DEFAULT_SHOW_ALL setting commit (jeroenrnl)
 * Removed LANG_DIR configuration item commit (jeroenrnl)
 * Changed the looks of fields a bit commit (jeroenrnl)
 * Removed alternative password validators commit (jeroenrnl)
 * Removed checks for PHP 5.1 commit (jeroenrnl)
 * Adding CLI support for configuration commit (jeroenrnl)
 * issue#7 Added a favicon commit (jeroenrnl)
 * issue#18 Added "return" link on bulk edit page commit (jeroenrnl)
 * Added a script to migrate config to new db-based system commit (jeroenrnl)
 * issue#8 Made template selectible from webinterface commit (jeroenrnl)
 * Removed MAX_CRUMBS commit (jeroenrnl)

Bugs

 * Simplified CLI code & fixed bug in --autoadd commit (jeroenrnl)
 * issue#34 Rows and columns swapped on photos page commit (jeroenrnl)
 * issue#36 Webimporter does not import description commit (jeroenrnl)
 * issue#37 Can not add position on map using the mouse commit (jeroenrnl)
 * Fixed a bug that caused EXIF information in some (rare) cases to report the aperture wrong. commit (jeroenrnl)
 * Strict standards warning commit (jeroenrnl)

 * issue#45 Pagebreak inside HTML tags causes browser to render incorrectly commit (jeroenrnl)
 * issue#45 Added selectArray cache to zophTable commit (jeroenrnl)
 * issue#48 Repair photo ratings during import commit (jeroenrnl)
 * issue#50 Geonames project has changed URL and requires username commit (jeroenrnl)
 * issue#51 Fixed depth in tree display when autocorrect is off commit (jeroenrnl)

 * issue#39 Added support for session.upload_progress as APC replacement (PHP 5.4 compatibility) commit (jeroenrnl)
 * issue#38 CLI tries to lookup previous argument's value when looking up photographer commit (jeroenrnl)

Improvements
I have made quite a few improvements on the "inside" of Zoph. I have refactored many parts of Zoph to create cleaner, less duplicated and more robust code. I have introduced UnitTests (resulting in about 20% of Zoph's sourcecode now tested fully automatic for bugs). As a help to that, I am now using Sonar to automatically run these tests and also analyse Zoph code for other problems.

 * issue#29 First step in creating unittests for Zoph commit (Jeroen Roos)
 * Sonar Support commit (jeroenrnl)
 * Refactor of PHP part of Mapping implementation commit (jeroenrnl)
 * Move timezone-related global functions into class commit (jeroenrnl)
 * TimeZone object improvements commit (jeroenrnl)
 * Small change in way template is called on photo page (Full page templates are now "templates" and partial pages are "blocks") commit (jeroenrnl)

 * Refactor of htmlMimeMail.php commit (jeroenrnl)
 * Refactor of Mail_mimePart commit (jeroenrnl)
 * Refactor annotate photo, watermark photo, image.php commit (jeroenrnl)

 * Removed several global variables commit commit (jeroenrnl)

 * Finished refactor of MIME classes commit (jeroenrnl)

 * Refactor album, category, place, person, photo commit (jeroenrnl)
 * Refactor: getEditArray + unittests commit (jeroenrnl)
 * Further refactor of photo, album, person, place, category commit commit (jeroenrnl)
 * Refactor: move ratings out of photo object commit commit (jeroenrnl)
 * Refactor: moved relations from photo object to new photoRelations object commit (jeroenrnl)
 * Refactor: photo object commit (jeroenrnl)
 * Got rid of adding session_id to URL commit (jeroenrnl)
 * Modified internal database references to static commit (jeroenrnl)
 * Removed brackets from require and include statements commit (jeroenrnl)
 * Replaceed a die with exception commit (jeroenrnl)
 * Changed self-references in objects to use self:: commit (jeroenrnl)
 * Removed unused class smtp commit (jeroenrnl)
 * Made autoload a little more robust commit (jeroenrnl)
 * Changes to autoload so it works in unittests too. commit (jeroenrnl)

 * Removed unused RFC822 class commit (jeroenrnl)
 * Changed line-endings in mailMimePart.inc.php to unix-style commit (jeroenrnl)
 * Removed various unused variables commit (jeroenrnl)
 * Removed duplicate templates commit (jeroenrnl)
 * Removed unused $user from createPulldown calls. commit (jeroenrnl)

 * issue#40 Change documentation to Markdown commit commit commit commit commit commit commit commit (jeroenrnl)

 * Modified some queries to improve performance commit (jeroenrnl)

=Zoph 0.9.0.1= 18 Oct 2012

Zoph 0.9.0.1 is the first maintenance release for Zoph 0.9. It adds compatibility with MySQL 5.4.4 and later and PHP 5.4 support. Several bugs were fixed.

Bugs

 * issue#1 Changed TYPE=MyISAM to ENGINE=MyISAM for MySQL > 5.4.4 compatibility commit (jeroenrnl)
 * issue#2 Changed timestamp(14) into timestamp commit (jeroenrnl)
 * issue#3 Removed pass-by-reference for PHP 5.4 compatibility commit (jeroenrnl)
 * issue#6 Missing French translation commit (jeroenrnl)
 * issue#30 Remove warning about undefined variables commit commit commit (jeroenrnl)
 * issue#1 Fixed: PHP Notice: Array to string conversion commit (jeroenrnl)
 * issue#31 Fixed several errors in geotagging code commit (jeroenrnl)
 * issue#33 Fixed: no error message when rotate fails commit (jeroenrnl)
 * Fixed a small layout issue on the prefs page commit (jeroenrnl)

Older Releases

 * Changelog of releases 0.8 - 0.9
 * Changelog of older releases

title: Zoph/Changelog


text:
D'ni

D'ni Language

Welcome to the Wikibooks course on the D'ni language.

Table of contents

 * /Foreword/

Phonology and writing
Note: You will need the D'ni font to view characters correctly.
 * /Numbers/
 * /Alphabet and Phonology/

Parts of speech

 * /Pronouns/
 * /Verbs/
 * /Adverbs/
 * /Nouns/
 * /Conjunctions/
 * /Prepositions/

Other

 * /Derivations/
 * /Idioms/

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

title: D'ni


text:
Wikibooks talk:Computer software bookshelf

History
This bookshelf has had a long history, but in short:

 * Computer software that use to be found at the computing bookshelf can now be found in computer software.
 * General computing books that use to be found at the information technology bookshelf can now be found in computing.
 * IT certification related books can now be found in information technology
 * General technology books can now be found in technology.
 * Books should be properly categorized to ensure they can be found on subject pages.


text:
Talk:OCR A-Level Physics/The SI System of Units

If you are using English spellings (viz. metre), you should use gramme & kilogramme rather than gram / kilogramme.

Given that SI stands for Systeme International, it is better to talk about SI Units not SI System of Units.

 * Hi, In my experience (and I'm based in London, UK) no-one uses "gramme" or "kilogramme", but use "metre" along with "gram" and "kilogram". Also, a textbook that is endorsed br OCR uses the English spelling of metre, but adopts the American spelling of gram and kilogram.

 * I can see what you mean by "SI system of units", it is similar to saying "ATM machine". Though not perfectly grammatically correct, as a title it makes it clear and easily understandable to students that "SI" is a system used for units. If anyone can suggest a better title for the page that would be great, as I can't really think of anything else. I agree, though, that it should just be "SI units" in the text. --Krackpipe 10:08, 5 September 2005 (UTC)

 * How about "The International System of Units (SI)? Martinvl (discuss • contribs) 22:47, 26 October 2020 (UTC)

Pay no attention to me
I'm just trying out a few colour schemes for tables. I will apply them across the whole wikibook to make them easier on the eyes, and try to make it easier to read information from.

It's a shame that the PNGs aren't trantsparent. :( --Krackpipe 23:05, 1 December 2005 (UTC)

Copy-editing
I have taken the liberty of copy-editing the page.

Firstly, according to the SI Brochure (which is the definitive guide to SI), units should always be written in upright Roman characters (Chapter 5).

Secondly, in my view, TeX parses poorly in Wikipedia which is why I have put the TeX formulae on a separate line, indented one tab. Martinvl (discuss • contribs) 21:56, 28 February 2014 (UTC)


text: Template:Visual Basic/ClassicNav1

title: Template:Visual Basic/ClassicNav1


text:
Chess Opening Theory/1. e4/1...Nf6

= Alekhine's Defence =

1...Nf6
The main idea of the Alekhine is to allow White to advance and push pawns, which Black can pick at later. While it is not played very often at master level, it is not unsound. White's most popular continuation is /2. e5/, and White has dreams of advancing in the center with d4, later c4, and sometimes even f4. Black hopes to attack and destroy White's pawn center in the future.

If White doesn't want to follow the main line, they may simply defend the pawn with /2. Nc3/ (which may transpose to Vienna Game).

A sharp variation called the Krejcik Variation consists in playing /2. Bc4/. It looks like a gambit, but in fact, if Black plays 2...Nxe4, White can regain the pawn and prevent Black from castling with 3. Bxf7+ Kxf7 4. Qh5+.

The opening is named after Alexander Alekhine, who introduced it in 1921; however, the theory and mainlines were created much later.

Theory table
1.e4 Nf6

title: Chess Opening Theory/1. e4/1...Nf6


text:
Rebol Programming/Language Features/Types

Datatypes
Generally datatypes are sets of values and some operations that can be performed with the values. The main purpose of knowing a datatype of a value is to know the operations we can perform with the value.

Dynamic typing
The following code is legal in Rebol:

>> x: 1 == 1 >> x: "2" == "2"

This property can be described by saying, that Rebol is a dynamically typed language. Some Rebol users describe it by saying, that datatypes are associated with Rebol values, not with variables.

Type safety
The following code is illegal in Rebol:

>> x: 1 + "2" ** Script Error: Cannot use add on string! value ** Near: x: 1 + "2"

This is called type safety and is caused by the fact, that neither the integer value 1 nor the string "2" is automatically converted when the expression is evaluated.

Rich set of datatypes
Rebol has 45 basic datatypes to handle real world concepts like URLs, email addresses, telephone numbers, currency amounts. By stigmatizing each value with a value type, Rebol restricts the kinds of things that a program can do to values.

The richness facilitates the readability of Rebol scripts as well as block parsing as described elsewhere.

With the money! datatype, it is easy to do some basic accounting

>> AU$1.00 + AU$0.50 == AU$1.50

Rebol even ensures that we keep to the same currency

>> AU$1.00 + US$0.02 ** Script Error: AU$1.00 not same denomination as US$0.02 ** Near: AU$1.00 + US$0.02

Date calculations are as simple as

>> now - 1-Jan-2005 == 251

where now happens to be today's date of 9-Sep-2005.

Datatypes are also how we can specify that functions only take certain values. A function that expects to deal with files does not want to see an email! type of input.

print-file: func [ file [file!] ][    print read file ]

>> print-file support@wikibooks.org ** Script Error: print-file expected file argument of type: file ** Near: print-file support@wikibooks.org

The datatype safety means that Rebol protects us from mixing different types which might cause unexpected errors. However, we can specify that a function be polymorphic i.e. is able to accept more than one basic datatype for its argument.

type? is an example of a polymorphic function in that it will accept an argument of any datatype and yield its datatype as a result.

>> type? http://www.rebol.com == url!

Rebol datatypes can be divided to two groups: virtual datatypes and basic datatypes. Virtual datatypes are datatypes that serve as common "ancestors" for groups of basic datatypes.

Type conversion
As stated above, there is no implicit type conversion in Rebol, i.e. when we want to convert a value to a specific datatype, we have to do it explicitly and the conversion needs to be possible. This is how to convert a string to an integer:

>> to integer! "145" == 145

This rule seems to be contradicted by working code such as:

>> 1 + 2.0 == 3.0

which must have converted the integer 1 to a decimal before adding it to the decimal 2.0. However, the arguments are not converted by the Rebol interpreter before they get to the + operator. It is the + operator which is able to accept and convert that particular combination of types (integer and decimal) before doing its work and returning the result.

Generally the to function is the first function to consider when we are doing a type conversion. The type argument of the to function may be an example value instead of a datatype:

>> to 1 "145" == 145


text:
Rebol Programming/Debugging techniques

Debugging techniques
There are various debugging tools available in Rebol.

Probe
Probe is a highly useful tool. What it does, is read the return values of functions and output them on the console. The return value is passed through probe, so you can insert it anywhere in your program.

>> wallet: $25 == $25.00 >> probe wallet $25.00 == $25.00

The value is both printed and returned as a value, because probe lets the return value pass through itself, as opposed to print, which doesn't return a useful value.

A more useful example:

>> add 3 probe add 2 2 4 == 7

NOTE: Be careful with probing large objects as they can take a very long time to print on the console. Large amounts of output can be stopped by pressing Escape.

Trace
Trace can help you to see function calls or TCP/IP network statistics on the console.

>> trace/func on

Trace/func returns a large amount of feedback, so it's wise only to activate it around the code you need to examine.

trace/func on ... some problematic code ... trace/func off

>> trace/net on

Protect-system
it is easy in Rebol to accidentally redefine a system word, as all words can be redefined. This code will cause strange things to happen a long way away from the original error:

gt: func [a b] [ return: a < b ]

That stray ":" on the return redefines return rather than returning the expected result. Any later code that uses return may misbehave.

An answer may be to protect all existing words from change:

>> protect-system

Print
Adding print statements is a time-honored way of debugging code. Rebol has a neat way of letting you leave the statements in unactivated until needed

The trick is to define another word as a synonym of print, eg:

>> dprint: :print

And use that to add debugging print statements:

>> dprint ["my count is " my-count] >> dprint ["file info:" mold info? my-text-file.txt]

In production code, or when you want to turn the debugging statements off, simply add:

>> dprint: func [data] []

??
Rebol provides specific functions to help with debugging. The function ?? prints a variable name followed by its molded value. Unlike the print function, it also returns the value it receives.

>> test: "Hello" == "Hello" >> value: ?? test test: "Hello" == "Hello" >> ?? value value: "Hello" == "Hello"

Once you have finished debugging, you can either remove all the ?? from the source, or just redefine ?? so that it just passes the value as though it were no longer present.

??: func [val] [val]

Adding a debugging option to GUI programs
While a VID program is running, you can't use the console to type print or ?? or any other debugging functions. One way round that is to add a console input field to your VID program, and execute whatever is typed into that:

view layout [ button "Add" [field1/text: 1 + to-integer field1/text show field1] label "number" field1: field 100 "1" label "console:" console: field 100 [attempt [do console/text]] ]

Try typing help view into the field labeled console.

Quickly restarting a GUI program
You can shave off a tiny bit of debugging time, by adding a simple button to your program that quits the program and starts it again.

unview/all do %

Stopping and continuing programs
Stopping a program to the console can be done with Escape key.

Continuing GUI programs can be done with do-events command.

title: Rebol Programming/Debugging techniques


text:
User:Swensorm

I am a Christian. I hold a BS in Computer Science with minors in Mathematics and Physics. I emphasized in taking electronics and computer architecture courses.

I have an extensive list of interests and hobbies. Currently the major ones consist of:
 * Christ
 * Electronics
 * Learning Latin
 * Developing Web Applications

What I'm Contributing to
Electronics

title: User:Swensorm


text:
User:MathMan64~enwikibooks/Arithmetic

= Arithmetic =

This book is designed for readers who want a thorough study of the concepts of Arithmetic. They will find enough detail and examples to apply the ideas found here to a variety of situations. The concepts of Arithmetic are useful in the everyday world, and they are necessary in the study of higher level mathematics as well as in science and many other curriculums. Arithmetic is, in fact, the basis and foundation for all other mathematical topics.

Notation and Rounding
The Arabic numeral system is used in many cultures. It uses the ten familiar digits. The concept of place value assigns value to each digit based on its location in relation to the others. The word name of a number is used when it is spoken. Word names can be used in written communication as well.

 * Notation

When an exact number is not needed the rounding process is applied. Numbers are often rounded off after a calculation. All measurements are approximate values. When asked the price of an item that costs $299.95, an appropriate answer is $300.

 * Rounding

Addition and Subtraction
Counting is the most basic process of mathematics. Addition is built on counting.

 * Addition

Subtraction is built on addition. Addition and subtraction can be considered two ways to look at the same situations from different perspectives.

 * Subtraction

Multiplication and Division
Multiplication is the cumulative result of repeated addition of the same value.

 * Multiplication

Division is built on multiplication. Multiplication and division can be considered two ways to look at the same situations from different perspectives.

 * Division

Exponents are used to indicate the repeated multiplication of the same value.

 * Exponents

Applications
Many times, for a calculation, what is expected is a quick result, that does not need a lot of accuracy. The processes of estimation can achieve this goal.

 * Estimation

Proportion is the most common process for comparing numbers or computing results.

 * Proportion

Percent is a common way of describing mathematical relationships in business and other application areas.

 * Percent

When a situation arises that requires more than one calculation step, there is a standard way of deciding what order to the calculations in.

 * Order of operations

Factors and Primes
The process of factoring is used in several area of mathematics. In this book, factoring will be used in working with fractions. When reducing, adding or subtracting fractions, being able to factor numbers is important. The most complete factoring process will yield a series of primes, which when multiplied result in the original number.

 * Factoring

Introduction to Fractions

 * Notation
 * Reducing
 * Decimals and fractions

Multiplication and Division

 * Multiplication
 * Improper fractions to mixed numbers
 * Division
 * Mixed numbers to improper fractions
 * Multiplication and division of mixed numbers
 * Proportion

Addition and Subtraction

 * Addition and subtraction with like denominators
 * Least common multiple
 * Common denominator
 * Addition and subtraction with unlike denominators
 * Addition and subtraction of mixed numbers
 * Order of Operations

title: User:MathMan64~enwikibooks/Arithmetic


text:
User talk:MathMan64~enwikibooks/Arithmetic

I plan to write an Arithmetic textbook.

It will have a different goal from Algebra/Arithmetic.

It may eventually replace Applied Math Basics


text:
Puzzles/Logic puzzles/Two Cities - Same Response/Solution

Puzzles | Logic puzzles | Two Cities - Same Response | Solution

Can you tell the truth?

OR

Which city are you from?

etc...


text:
Wikijunior:Solar System/Neptune/Proteus

Proteus is a moon of the planet Neptune. It is sometimes called Neptune VIII. We still do not know a lot about this moon, as only a few pictures have been taken when the Voyager 2 flew by in 1989.

How big is it?
This moon is uneven in shape and has an average size of just over 400 km across. This moon is nearly as a big as a satellite can be without it being pulled into a sphere by its own gravity. Even though it is a small moon, it is the second largest moon of Neptune after Triton.

What is its surface like?
The surface of this moon is covered in craters and some grooves. It is also a very dark moon, with a ground that is as dark as soot. It is one of the darkest objects in the Solar System.

How long is Proteus's revolution?
It takes 1 day, 2 hours, and 56 minutes for this moon to orbit the planet Neptune.

Who is it named after?
This moon is named for a sea god from ancient Greek mythology. In some tales he was the first son of Poseidon, the ancient Greek god of the sea. The Romans later called him Neptune, so Proteus was the first son of Neptune.

In Greek mythology, Proteus was able to foretell the future. He was also able to change his shape, and he used this ability to avoid being asked about what is to come.

How was it discovered?
Proteus was discovered in 1989 when the Voyager 2 spacecraft flew by Neptune.

Wikijunior Sonnensystem/ Neptun/ Proteus

title: Wikijunior:Solar System/Neptune/Proteus


text:
Probability/Important Distributions

Motivation
Consider $${\color{blue}n}$$ independent Bernoulli trials with the same success probability $${\color{darkgreen}p}$$. We would like to calculate to probability $$\mathbb P(\{{\color{darkgreen}r}\text{ successes in }{\color{blue}n}\text{ trials}\})$$.

Let $$S_i$$ be the event $$\{i\text{th Bernoulli trial is a success}\},\quad i=1,2,\dotsc$$, as in the previous section. Let's consider a particular sequence of outcomes such that there are $${\color{darkgreen}r}$$ successes in $${\color{blue}n}$$ trials: $${\color{darkgreen}\underbrace{S\cdots S}_{r\text{ successes}}}{\color{red}\overbrace{F\cdots F}^{{\color{blue}n}-{\color{darkgreen}r}\text{ failures}}}$$ Its probability is $$\mathbb P({\color{darkgreen}S_1\cap\dotsb S_r}\cap {\color{red}S^c_{r+1}\cap\dotsb\cap S^c_{\color{blue}n}})\overset{\text{ indpt. }}{=} {\color{darkgreen}\mathbb P(S_1)\dotsb\mathbb P(S_r)}{\color{red}\mathbb P(S_{r+1}^c)\cdots\mathbb P(S_^c)} ={\color{darkgreen}p^r}{\color{red}(1-{\color{darkgreen}p})^{{\color{blue}n}-{\color{darkgreen}r}}}$$ Since the probability of other sequences with some of $${\color{darkgreen}r}$$ successes occurring in other trials is the , and there are $$\binom$$ distinct possible sequences , $$\mathbb P(\{{\color{darkgreen}r}\text{ successes in }{\color{blue}n}\text{ trials}\})=\binom{\color{darkgreen}p}^{\color{darkgreen}r}{\color{red}(1-{\color{darkgreen}p})^{{\color{blue}n}-{\color{darkgreen}r}}}.$$ This is the pmf of a random variable following the.

Bernoulli distribution
Bernoulli distribution is simply a special case of distribution, as follows:

Motivation
The Poisson distribution can be viewed as the 'limit case' for the binomial distribution.

Consider $${\color{blue}n}$$ independent Bernoulli trials with success probability $${\color{darkgreen}p}=\lambda/{\color{blue}n}$$. By the binomial distribution, $$\mathbb P({\color{darkgreen}r}\text{ successes in }{\color{blue}n}\text{ trials})=\binom{\color{darkgreen}(\lambda/{\color{blue}n})^r}{\color{red}(1-\lambda/{\color{blue}n})^{{\color{blue}n}-{\color{darkgreen}r}}}.$$

After that, consider an unit time interval, with (positive) $$\lambda$$ of a rare event (i.e. the  of number of occurrence of the rare event is $$\lambda$$). We can divide the unit time interval to $${\color{blue}n}$$ time subintervals of time length $$1/{\color{blue}n}$$ each. If $${\color{blue}n}$$ is and $${\color{darkgreen}p}$$ is, such that the probability for occurrence of two or more at a single time interval is negligible, then the probability for occurrence of for each time subinterval is $${\color{darkgreen}p}=\lambda/{\color{blue}n}$$ by definition of mean. Then, we can view the unit time interval as a sequence of $${\color{blue}n}$$ Bernoulli trials with success probability $${\color{darkgreen}p}=\lambda/{\color{blue}n}$$. After that, we can use $$\operatorname{Binom}{({\color{blue}n},\lambda/{\color{blue}n})}$$ to model the number of occurrences of. To be more precise, $$ \begin{align} \mathbb P(\underbrace{{\color{darkgreen}r}\text{ successes in }{\color{blue}n}\text{ trials}}_{{\color{darkgreen}r}\text{ rare events in the unit time}}) &=\binom{\color{darkgreen}(\lambda/{\color{blue}n})^r}{\color{red}(1-\lambda/{\color{blue}n})^{{\color{blue}n}-{\color{darkgreen}r}}}\\ &=\frac{{\color{blue}n}({\color{blue}n}-1)\dotsb({\color{blue}n}-{\color{darkgreen}r}+1)}{{\color{darkgreen}r}!}(\lambda^{\color{darkgreen}r}/{\color{blue}n}^{\color{darkgreen}r})(1-\lambda/{\color{blue}n})^{{\color{blue}n}-{\color{darkgreen}r}}\\ &=(\lambda^{\color{darkgreen}r}/{\color{darkgreen}r}!)\overbrace{(1-\underbrace{1/{\color{blue}n}}_{\to 0\text{ as }n\to\infty})\dotsb\big(1-\underbrace{({\color{darkgreen}r-1})/{\color{blue}n}}_{\to 0\text{ as }n\to\infty}\big)}^{\to 1\text{ as }n\to\infty}\underbrace{(1-\lambda/{\color{blue}n})^{\overbrace{{\color{blue}n}-{\color{darkgreen}r}}^{\to n\text{ as }n\to\infty}}}_{\to e^{-\lambda}\text{ as }n\to\infty}\\ &\to e^{-\lambda}\lambda^/{\color{darkgreen}r}!\text{ as }n\to\infty. \end{align} $$ This is the pmf of a random variable following the , and this result is known as the (or law of rare events). We will introduce it formally after introducing the definition of.

Motivation
Consider a sequence of independent Bernoulli trials with success probability $${\color{darkgreen}p}$$. We would like to calculate the probability $$\mathbb P(\{{\color{red}x}\text{ failures before first success}\})$$. By considering this sequence of outcomes: $${\color{red}\underbrace{F\cdots F}_{{\color{red}x}\text{ failures}}}{\color{darkgreen}S},$$ we can calculate that $$\mathbb P(\{{\color{red}x}\text{ failures before first success}\})={\color{red}(1-{\color{darkgreen}p})^x}{\color{darkgreen}p},\quad{\color{red}x}\in\operatorname{supp}(X)=\{0,1,2,\dotsc\}$$ This is the pmf of a random variable following the.

Motivation
Consider a sequence of independent Bernoulli trials with success probability $${\color{darkgreen}p}$$. We would like to calculate the probability $$\mathbb P(\{{\color{red}x}\text{ failures before }{\color{darkgreen}k}\text{th success}\})$$. By considering this sequence of outcomes: $$ \overbrace{ {\color{red}\underbrace{F\cdots F}_{x_1\text{ failures}}}{\color{darkgreen}S} {\color{red}\underbrace{F\cdots F}_{x_2\text{ failures}}}{\color{darkgreen}S} \cdots {\color{red}\underbrace{F\cdots F}_{x_k\text{ failures}}} }^{{\color{red}x}+{\color{darkgreen}k}-1\text{ trials}} {\color{darkgreen}\overbrace{S}^{k\text{th success}}}, \quad {\color{red}x_1}+{\color{red}x_2}+\dotsb+{\color{red}x_k}={\color{red}x}, $$ we can calculate that $$\mathbb P(\{{\color{red}x}\text{ failures before }{\color{darkgreen}k}\text{th success}\})={\color{red}(1-{\color{darkgreen}p})^x}{\color{darkgreen}p^k},\quad{\color{red}x}\in\operatorname{supp}(X)=\{0,1,2,\dotsc\}.$$ Since the probability of other sequences with some of $${\color{red}x}$$ failures occuring in other trials (and some of $${\color{darkgreen}k}-1$$ successes (excluding the $${\color{darkgreen}k}$$th success, which must occur in the last trial) occuring in other trials), is the, and there are $$\binom{{\color{red}x}+{\color{darkgreen}k}-1}$$ (or $$\binom{{\color{red}x}+{\color{darkgreen}k}-1}{{\color{green}k}-1}$$, which is the same numerically) distinct possible sequences , $$\mathbb P(\{{\color{red}x}\text{ failures before }{\color{darkgreen}k}\text{th success}\}) =\binom{{\color{red}x}+{\color{darkgreen}k}-1}{\color{red}(1-{\color{darkgreen}p})^x}{\color{darkgreen}p^k}, \quad{\color{red}x}\in\operatorname{supp}(X)=\{0,1,2,\dotsc\}.$$ This is the pmf of a random variable following the.

Motivation
Consider a sample of size $$n$$ are drawn without replacement from a population size $$N$$, containing $$K$$ objects of type 1 and $$N-K$$ of another type. Then, the probability $$\mathbb P(\{k\text{ type 1 objects are found when }n\text{ objects are drawn from }N\text{ objects}\})=\underbrace{\binom{K}{k}}_{\text{type 1}}\overbrace{\binom{N-K}{n-k}}^{\text{another type}}\bigg/\underbrace{\binom{N}{n}}_{\text{all outcomes}},\quad k\in\big\{\max\{n-N+K,0\},\dotsc,\min{\{K,n\}}\big\}$$ . This is the pmf of a random variable following the.
 * $$\binom{K}{k}$$: unordered selection of $$k$$ objects of type 1 from $$K$$ (distinguishable) objects of type 1 without replacement;
 * $$\binom{N-K}{n-k}$$: unordered selection of $$n-k$$ objects of another type from $$N-K$$ (distinguishable) objects of another type without replacement;
 * $$\binom{N}{n}$$: unordered selection of $$n$$ objects from $$N$$ (distinguishable) objects without replacement.

Finite discrete distribution
This type of distribution is a generalization of all discrete distribution with finite support, e.g. Bernoulli distribution and hypergeometric distribution.

Another special case of this type of distribution is, which is similar to the (will be discussed later).

Uniform distribution (continuous)
The is a model for 'no preference', i.e. all intervals of the same length on its support are (it can be seen from the pdf corresponding to continuous uniform distribution). There is also uniform distribution, but it is less important than  uniform distribution. So, from now on, simply 'uniform distribution' refers to the one, instead of the discrete one.

Exponential distribution
The distribution with  parameter $$\lambda$$ is often used to describe the  of rare events with rate $$\lambda$$.

Comparing this with the distribution, the  distribution describes the interarrival  of rare events, while distribution describes the  of occurrences of rare events within a fixed time interval.

By definition of, when the $$\uparrow$$, then  $$\downarrow$$ (i.e. frequency of the rare event $$\uparrow$$).

So, we would like the pdf to be more skewed to left when $$\lambda\uparrow$$(i.e. the pdf has higher value for small $$x$$ when $$\lambda\uparrow$$), so that areas under the pdf for intervals involving small value of $$x$$ $$\uparrow$$ when $$\lambda\uparrow$$.

Also, since with a fixed rate $$\lambda$$, the interarrival time should be less likely of higher value. So, intuitively, we would also like the pdf to be a strictly function, so that the probability involved (area under the pdf for some interval) $$\downarrow$$ when $$x\uparrow$$.

As we can see, the pdf of exponential distribution satisfies both of these properties.

Gamma distribution
distribution is a generalized distribution, in the sense that we can also change the  of the pdf of  distribution.

Beta distribution
distribution is a generalized $$\mathcal U[0,1]$$, in the sense that we can also change the of the pdf, using.

Cauchy distribution
The distribution is a  distribution. As a result, it is a 'pathological' distribution, in the sense that it has some counter-intuitive properties, e.g. undefined mean and variance, despite its mean and variance to be defined when we look at its graph directly.

Normal distribution (very important)
The normal or Gaussian distribution is a thing of beauty, appearing in many places in nature. This is probably because sample means or sample sums often follow distributions by. As a result, the distribution is important in statistics.

Important distributions for statistics especially
The following distributions are important in statistics especially, and they are all related to normal distribution. We will introduce them briefly.

Chi-squared distribution
The distribution is a special case of Gamma distribution, and also related to  distribution.

Student's t-distribution
The is related to  distribution and  distribution.

F-distribution
The $$F$$-distribution is sort of a generalized Student's $$t$$-distribution, in the sense that it has one more changeable parameter for another degrees of freedom.

If you are interested in knowing how, , and are useful in statistics, then you may briefly look at, for instance, Statistics/Interval Estimation (applications in confidence interval construction) and Statistics/Hypothesis Testing (applications in hypothesis testing).

Motivation
Multinomial distribution is binomial distribution, in the sense that each trial has more than two outcomes.

Suppose $$n$$ objects are to be allocated to $$k$$ cells independently, for which each object is allocated to cell, with probability $$p_i$$ to be allocated to the $$i$$th cell ($$i=1,2,\dotsc,k$$). Let $$X_i$$ be the number of objects allocated to cell $$i$$. We would like to calculate the probability $$\mathbb P\big(\mathbf X\overset{\text{ def }}=(X_1,\dotsc,X_k)^T=\mathbf x\overset{\text{ def }}=(x_1,\dotsc,x_k)^T\big)$$, i.e. the probability that $$i$$th cell has $$x_i$$ objects.

We can regard each allocation as an independent trial with $$k$$ outcomes (since it can be allocated to one and only one of $$k$$ cells). We can recognize that the allocation of $$n$$ objects is partition of $$n$$ objects into $$k$$ groups. There are hence $$\binom{n}{x_1,\dotsc,x_k}$$ ways of allocation.

So, $$\mathbb P(\mathbf X=\mathbf x)=\binom{n}{x_1,\dotsc,x_k}p_1^{x_1}\dotsb p_k^{x_k}.$$ In particular, the probability of allocating $$x_i$$ objects to $$i$$th cell is $$p_i^{x_i}$$ by independence, and so that of a particular case of allocation of $$n$$ objects to $$k$$ cells is $$p_1^{x_1}\dotsb p_k^{x_k}$$ by independence.

Multivariate normal distribution
normal distribution is, as suggested by its name, a multivariate (and also generalized) version of the normal distribution (univariate).

title: Probability/Important Distributions


text:
User:Scagnoli~enwikibooks

Norma I. Scagnoli works as Director of elearning at the [| College of Business] at the University of Illinois. She has been involved in research on online learning in the last 10 years and she has extensive experience in national and international projects. Her most important achievements in Wikibooks are the initiation of the following books: [| Blended Learning in K-12], [| Aprendizaje colaborativo] and [| Aprendizaje combinado]. [Norma Scagnoli's Homepage]

title: User:Scagnoli~enwikibooks


text:
User:Nkrypt

pNoc6DZXGT4qpNoc196jo15m6DZXC5PQGT4qyzOFGT4q6DZXaoB2uO79B0Vx4iqL6DZX196j4iqLSNL7mm99

title: User:Nkrypt


text:
Wikijunior talk:Ancient Civilizations/Indus Valley

Wikivoyage links?
WV has a good article on Mohenjo-daro and some coverage on Harappa. 220.160.66.76 (discuss) 02:38, 22 March 2015 (UTC)


text:
Rebol Programming/Language Features/Control

REBOL offers a variety of different control structures with many similar to those seen in other computer languages, and some unique to itself.

All
all: native [ {Shortcut AND. Evaluates and returns at the first FALSE or NONE.} block [block!] "Block of expressions" ]

all is a useful function that allows one to check to see if all the expressions in a block evaluate to true or not. It obviates the need for cascading the either constructs.

>> all [true true true] == true

>> all [true true false] == none

Now, the useful thing is that although we can use it to test for multiple conditions as above, we can perform multiple tasks inside the block as long as each expression returns a value distinct from false or none.

all [ create-pdf-of-newsletter ftp-newsletter-to-website check-newsletter-not-corrupt update-webpage-last-change-date spam-our-customers ]

Interestingly, the all construct ensures that all of the preceding expressions must be true before we complete our list of tasks, and spam-our-customers. We wouldn't want to do this if the update to our website had not completed!

The above example takes advantage of an important property of all which is that it does not evaluate further when it encounters false or none. This way the preceding conditions can "guard" the subsequent ones, like e.g.:

>> x: 0 == 0 >> all [x <> 0 1 / x < 2] == none

The same would not be true when using the and operator:

>> (x <> 0) and (1 / x < 2) ** Math Error: Attempt to divide by zero ** Near: 1 / x < 2

NB: Although the help for all says that it is shortcut for and, it is not really. So, note the following

>> all [ true ] == true >> all [ true false ] == none

where the return value is none and not a logic! false.

Any
any: native [ {Shortcut OR. Evaluates and returns the first value that is not FALSE or NONE.} block [block!] "Block of expressions" ]

any returns true if any of the expressions inside the block returns true.

>> any [false false false true] == true

Similarly as with all, any "guards" the subsequent conditions, if it encounters a value considered true (i.e. anything distinct from false and none). Again, this property does not hold for the or operator.

If, Either and Unless
if: native [ "If condition is TRUE, evaluates the block." condition then-block [block!] /else "If not true, evaluate this block" else-block [block!] ]

The if function allows one to conditionally evaluate a block if the condition argument is true (which means, distinct from false or none). Otherwise if returns none. If the /else refinement is used, then the second block is evaluated in case the condition is false.

While condition can be the result of a simple expression such as

>> if/else 5 < 10 [print "less than 10"] [print "greater than or equal to 10"] less than 10

'''Warning: the  refinement may not be supported in the future versions of Rebol, being considered obsolete! It is faster and future-proof to use the  native instead.'''

The condition can be a result of any legal function that returns a value. So, if you had a function named web-update? that checks to see if a particular page has been updated in the last few days, you could write

>> if web-update? http://www.rebol.com [print "Rebol Tech has updated their website!"]

The either native function is conditionally evaluates its second argument (the true-block), if the first argument (the condition) is true (i.e. distinct from false and none), otherwise it evaluates its third argument (the false-block).

>> either now/time < 12:00 [print "Good Morning"] [print "Good Afternoon"]

Truth in Rebol is somewhat different from the English language use of the same term. Anything that is not false or none is treated as true. This means that all integers, including 0, are treated as true as well as all blocks, etc.

>> if [] [print "even an empty block is true"] even an empty block is treated as true

Beginner gotcha: you should especially take care of:

>> either [false] [true] [false] == true

, because the block is treated as true. The same holds for 0:

>> either 0 [true] [false] == true

In place of the if not combination, we can use the unless function. Example:

>> if not 2 > 3 ["OK"] == "OK"

>> unless 2 > 3 ["OK"] == "OK"

Case
The general case expression form can be:

case [ condition1 block1 condition2 block2 etc.   ]

Conditions are evaluated and checked one after another. If true, the block following the condition is evaluated and returned as the case result.

Case enhances readability replacing nested either. Example:

wife-birthday: 1-March-1960 Valentines-day: 14-Feb-1900 wedding-anniversary: 1-April-1980 anniversary?: func [ date [date!] {check to see if today's date is an anniversary of the argument} ][    all [date/day = now/day date/month = now/month] ] greeting: case [ anniversary? wife-birthday ["Happy birthday dear"] anniversary? Valentines-day ["Happy Valentines dear"] anniversary? wedding-anniversary ["Happy anniversary dear"] true ["Hello dear"] ]

The example above would have been almost unreadable when written using either. Notice the true condition intended to yield "Hello dear" if none of the previous conditions was true.

Switch
USAGE: SWITCH value cases /default case DESCRIPTION: Selects a choice and evaluates what follows it. SWITCH is a function value. ARGUMENTS: value -- Value to search for. (Type: any) cases -- Block of cases to search. (Type: block) REFINEMENTS: /default case -- Default case if no others are found. (Type: any) (SPECIAL ATTRIBUTES) throw

switch is similar to the case function. However, it takes a single value, and then compares that to a block of value block pairs. If the value matches, it evaluates the block, and returns its value leaving the function at that point. If there is no match, it returns none. If the default refinement is specified, then the optional last block is evaluated.

Let us say that we wish to implement a POP3 server. We know that the POP3 server is state driven, and has 2 states, an authorisation state, and a transaction state. In each of these states, the POP3 server will only accept certain commands.

state: 'transaction command: 'RETR .. .. switch/default state [ transaction [ ... contains another switch to check for valid transaction commands ... ]    authorisation [ ... contains another switch to check for valid authorisation commands ... ] ] [print "Unknown state error"]

The authorisation switch might look like this, where the words in the blocks are pseudocode.

switch/default command [ user [check to see if valid user syntax] pass [check to see if valid username and password combination] apop [change authentication method] quit [close connection and wait for next user] ] [print "Unknown command in authorisation mode"]

In both of the above examples we have used word values for the switch, but any Rebol value can be used.

switch 3 [ 3 [print "3 received"] 4 [print "4 received"] ]

For
USAGE: FOR 'word start end bump body DESCRIPTION: Repeats a block over a range of values. FOR is a function value. ARGUMENTS: word -- Variable to hold current value (Type: word) start -- Starting value (Type: number series money time date char) end -- Ending value (Type: number series money time date char) bump -- Amount to skip each time (Type: number money time char) body -- Block to evaluate (Type: block) (SPECIAL ATTRIBUTES) catch throw

for is much like the traditional for loop structure seen in other languages with a small twist - the increment, or bump amount, can be in a datatype other than integer! as is usually required.

So, if you wish to write a loop where the counter value is incremented in a money! type, we can do this:

for opinion $0 $.10 $0.02 [ print ["here is my 2c again totalling " opinion] ]

giving

here is my 2c again totalling $0.00 here is my 2c again totalling $0.02 here is my 2c again totalling $0.04 here is my 2c again totalling $0.06 here is my 2c again totalling $0.08 here is my 2c again totalling $0.10

In case the repeat control function is suitable for the job, prefer repeat, it is faster.

Forall
USAGE: FORALL 'word body DESCRIPTION: Evaluates a block for every value in a series. FORALL is a function value. ARGUMENTS: word -- Word set to each position in series and changed as a result (Type: word) body -- Block to evaluate each time (Type: block) (SPECIAL ATTRIBUTES) catch

The most used loop in Rebol is foreach. But with foreach we can not change the current value as it does not give us the series-position. forall was created for that case as it gives us the position instead of the current value.

As the series is traversed, the current value becomes the first element of the series.

We can change the first element like this:

my-series: [1 2 3 4] forall my-series [ change my-series (first my-series) * first my-series ]

>> my-series == [1 4 9 16]

In the example above, all members of my-series are squared.

Another way to access the series is with path-notation, like my-series/1. Then it looks

my-series: [1 2 3 4] forall my-series [ my-series/1: my-series/1 * my-series/1 ]

which is sometimes more comfortable.

The other advantage that forall gives you over foreach is that you have access to the index of the current element within the series being traversed.

forall my-series [ print index? my-series ]

Note that 'my-series is altered in the loop. Under certain circumstances that change stays even if the loop terminated. That happens on a break, or on an error, and is intentional.

my-series: [1 2 3 4] forall my-series [ if 3 = first my-series [break] ]

>> my-series == [3 4]

In pre view1.3/core 2.6 releases of Rebol, the series stayed at the tail on completion of the loop which was a source of confusion for many.

Thats why you find forall series [..] series: head series in some older code.

Forskip
USAGE: FORSKIP 'word skip-num body DESCRIPTION: Evaluates a block for periodic values in a series. FORSKIP is a function value. ARGUMENTS: word -- Word set to each position in series and changed as a result (Type: word) skip-num -- Number of values to skip each time (Type: integer) body -- Block to evaluate each time (Type: block) (SPECIAL ATTRIBUTES) throw catch

forskip is similar to forall in that it traverses a series while making the current element the first element of the series. It is different in that forskip allows you to move through the series by a specified integer amount. From 1.3, it also reset the series on completion. The same advantages forall has over foreach apply to forskip. Example:

areacodes: [ "Ukiah"        707 "San Francisco" 415 "Sacramento"   916 ] forskip areacodes 2 [ print [first areacodes "area code is" second areacodes] ]

produces the following output

Ukiah area code is 707 San Francisco area code is 415 Sacramento area code is 916

Say we now wanted to add 1000 to the area code. Here's one way of doing that using forskip

reverse areacodes ; so that the area code is the first element forskip areacodes 2 [ change areacodes add 1000 first areacodes ] reverse areacodes ; and set it back to the original format

giving [   "Ukiah" 1707 "San Francisco" 1415 "Sacramento" 1916 ]

And here's an alternate way of doing this using the path notation which removes the necessity to reverse the series:

forskip areacodes 2 [ areacodes/2: add 1000 areacodes/2 ]

Foreach
USAGE: FOREACH 'word data body DESCRIPTION: Evaluates a block for each value(s) in a series. FOREACH is a native value. ARGUMENTS: word -- Word or block of words to set each time (will be local) (Type: get-word word block) data -- The series to traverse (Type: series) body -- Block to evaluate

foreach is arguably the most common repetition structure used in Rebol. Like the majority of repetition structures, it does not affect the series it traverses.

files: read %./ foreach file files [ print file ]

In this example, the current directory is read and stored as a series in the word files. In the foreach structure, the temporary variable file is assigned the value of the current element in the series, and then printed to the console. The temporary variable file is local only to the evaluation block.

This can also be written as

foreach file read %./ [ print file ]

doing away with the necessity to define the word files. If you really do want the word files, you can also do this

foreach file files: read %./ [ print file ]

saving one line in your source code.

If your series comes in pairs, you can create a pair of temporary variables

names: ["Joe" "Bloggs" "Jane" "Doe"] foreach [first-name surname] names [ print [first-name " " surname] ]

which prints the first name, a space, the surname, and then starts a newline.

Forever
Forever evaluates a block endlessly unless terminated at the console with the ESCAPE key, or a function inside the block.

What is it used for? Well, it could be used to increase one's Karmic credits! In Tibet mechanical prayer wheels are used to spin prayers such as "Om Mani Padme Hum". His Holiness the Dalai Lama has stated that computers can be used for the same effect (since the hard drive is also spinning).

So, here we have a Rebol prayer wheel in action

forever [ print "Om Mani Padme Hum" ]

However, a more common usage of forever is to set up a server loop

listen: open tcp://:12345 waitports: [listen] forever [ data: wait waitports either same? data listen [ active-port: first listen append waitports active-port ][           incoming-from-remote: first data print incoming-from-remote ]        ]

Loop
USAGE: LOOP count block DESCRIPTION: Evaluates a block a specified number of times. LOOP is a native value. ARGUMENTS: count -- Number of repetitions (Type: integer) block -- Block to evaluate (Type: block)

loop allows you to evaluate a block a specified number of times unless exited inside the block. However, there is no local counter accessible, so if you wish to track at which repetition, you will have to create your own variable for this. Alternatively you could use the for function.

result: loop 3 [print "hail Mary"] "Hail Mary" "Hail Mary" "Hail Mary"

loop returns the value of the last execution of the block, and is here assigned to result. If we had used print instead, we would have had an error as print does not return a value.

Repeat
USAGE: REPEAT 'word value body DESCRIPTION: Evaluates a block a number of times or over a series. REPEAT is a native value. ARGUMENTS: word -- Word to set each time (Type: word) value -- Maximum number or series to traverse (Type: integer series) body -- Block to evaluate each time (Type: block)

repeat evaluates a block, and has a local counter available. If the repetition value is an integer, then the counter starts at one, and reaches the repetition value.

repeat value 3 [ print value ] 1 2 3

If it is a series, then the "counter" takes the value in the series

repeat value ["a" "b" "c"] [ print value ] a b c

The final value is returned.

Until
Until is a control flow function checking the condition at the end of evaluation of its block argument. USAGE: UNTIL block

DESCRIPTION: Evaluates a block until it is TRUE. UNTIL is a native value.

ARGUMENTS: block -- (Type: block)

until evaluates a block repeatedly until the block evaluates to true.

until [ prin "Enter password: " pass: input/hide pass == "Uncle" ]

Here we prompt the user to input a password. If it matches the secret value, a true value is obtained, and we exit the block. We ensure that the test is case sensitive by using == rather than the case insensitive =.

While
USAGE: WHILE cond-block body-block DESCRIPTION: While a condition block is TRUE, evaluates another block. WHILE is a native value. ARGUMENTS: cond-block -- (Type: block) body-block -- (Type: block)

while differs from until in that the body-block may not be evaluated, whereas in until the body block is always evaluated at least once.

While also differs from similar control flow constructs in other programming languages by actually evaluating the condition "anywhere" in the repetition. It can generally be used as follows:

while [ do some pre-check stuff need-more-work? ; the check ] [   do some post-check stuff ]

, where neither the pre-check stuff, nor the post-check stuff are necessary.

This example is equivalent to forever

while [true] [ print "S.O.S." ]

, and it is a case when the condition is evaluated "at the start of a repetition", since no evaluation precedes the true expression in the cond-block.

Another example how to write an infinite loop using while:

while [print "Om Mani Padme Hum" true] []

, in this case the condition is actually evaluated "at the end of a repetition", since nothing is done after the cond-block (yielding the true value) is evaluated and before another repetition starts.

It is quite common to use while to skip through a series

while [not tail? my-series: next my-series] [ do something here ]

Break
There is a couple of methods that can be used to stop the repetition of any repetitive control function. Specifically we can use the break function. Compare the following code with the general example used in the while section:

while [true] [ do some pre-check stuff unless need-more-work? [break] do some post-check stuff ]

The break function has got a /return refinement enabling us to cause the repetitive control function to return a specific value.

There are two other methods which can be used to stop the repetition. We can use the return or exit function if the repetition is done in a function or the throw function, if the repetition is done in a catch block.


text:
System Monitoring with Xymon/Other Docs/FAQ/Generic Monitoring System Features

= Requirements for a Monitoring System =

Alerts

 * Send (Email/SMS/etc)
 * Acknowledge (display who is working on the issue)
 * Delay
 * Send to certain groups/individuals
 * Escalation Path

 * Ability to set severity of levels for each service test (eg, disk on a production server vs disk on a development server)
 * Different actions for different levels, i.e.
 * Level 1 (disk 95% full)   alert Help Desk
 * Level 2 (disk 98% full)   alert IT team

Display

 * Include or integrate with a real-time display system (with colours: Red, Yellow, Green, Purple,White and Blue)
 * Red:
 * Yellow:
 * Green:
 * White:
 * Purple:

 * Display a time of last check

 * Show high level "summary" of status. eg. group Unix boxes together and show if any have issues

 * Ability to customise the display. e.g. summary page for IT helpdesk, Unix page for Unix admins, Network page for Networking Team.

 * Ability to restrict access to the monitoring system (we do not want the general community to see everything monitored)

 * Ability to search for a host

Monitor

 * Microsoft Windows: Windows NT, Windows XP, Windows Vista.
 * Be able to process windows event logs and performance monitoring
 * UNIX: Solaris, AIX, HP-UX, IRIX, Linux, MacOS X, Tru64.
 * Services (DNS/FTP/SMTP/LDAP/etc)
 * Applications (Outlook, Calendar, Exchange, Certificate Services, Apache, Tomcat, etc)
 * HTTP Application Monitoring
 * Expected Content returned
 * Acceptable response time (10 seconds to load a web page is not okay)
 * Simulate a windows client application. e.g. click on an icon to launch Word.  Enter some text.  Save the document to a drive.  Close word.  Ensure the whole process worked.
 * Service level testing
 * e.g. a web application requires a web server, DNS, LDAP, etc. If the DNS server fails, then so will the web application.
 * Allow for cluster testing (e.g. 1 web server out of a cluster of 5 fails, notify about the web server outage, but not the web service outage)
 * Network File shares
 * SAN Monitoring
 * Citrix Servers and Services
 * Printers
 * Printer errors e.g. low toner
 * Print Queues
 * SNMP Devices
 * Hardware (i.e. Dell DRAC, Sun Solaris), both via hardware card and OS software.
 * UPS
 * Other environmental inputs (temperature, humidity, etc)
 * Nightly backup
 * Warn if backups take longer than expected
 * Alarm if some backups fail

Networking

 * Provide integration with Cisco Works, or have similar functionality
 * WAN links, LAN links, VLANs, etc
 * Verify link is up
 * Verify Bandwidth is not saturated
 * Cisco/Networking hardware
 * CPU load
 * Environmental e.g. Power supplies, temperature alarms, etc
 * Ability to interact with probes (break down traffic to type and size)
 * Capture and track changes to hardware configurations

OS Monitoring

 * Disk
 * Memory
 * Processes
 * Response time
 * CPU Load
 * Hardware failures
 * OS Alerts ( systems event logs and syslog )

Database monitoring

 * Oracle
 * MySQL
 * MSSQL
 * Ingres

File Monitoring

 * file growths, if exist etc

Customise

 * Easy to extend/Customise your own tests (API to integrate with)

Trending

 * Alert on trends, ie 10% growth over 1 month might be ok but over 2 hours isn't.
 * Provide trending for network bandwidth usage or any data collected

Integration

 * Integrate with a helpdesk/Trouble Ticket system
 * Automatically Submit Tickets
 * Automatically Update existing Tickets

 * Integrate with (or include) an Asset management system
 * Display serial number, manufacturer, warranty periods, history of repairs/replacement, etc

 * Integrate with other monitoring systems e.g. Ciscoworks, Oracle Enterprise Manager, HP, Compaq Insight Manager, etc

 * Integrate with with Microsoft Operations Manager (MOM) or offer the similar functionality as available in MOM

Agents

 * Locally installed agent to collect data (and temporarily store data locally)
 * Ability of central polling server to contact agent to get gathered data
 * Local agent has ability to send data to polling server
 * Ability to remotely update agents

Misc

 * History retention

 * Provide reports

 * Must be able to assign multiple IP addresses to each device and test each IP address individually if needed.

 * Minimal impact on service being monitored
 * Minimal effort to monitor (and manage) clients (remote devices)
 * Do not require upgrades to existing infrastructure (e.g. must run latest version of software before it can be monitored)

 * Ability for remote monitoring servers to report to a cental server

 * Dependency aware (if a core router fails, do not send 100 alarms for devices behind it)

 * Allow for scheduled downtime (disable a test in the future)
 * Require authorisation
 * Require a reason to be displayed

 * Allow for regular maintenance windows (application is restarted every sun night - do not send out alarms)

 * Ability to delegate testing to other devices (eg. tier management structure)

 * Audit history in monitoring system ( server added date, when was monitoring disabled and why etc )

 * The system must be able to self-monitor

 * Be able to monitor 1000+ devices

 * Allow variable polling (some tests every 5 mins, some tests every 1 min)

 * Highly Reliable

 * Redundancy (if your main monitoring server fails, have a second server on standby)

 * Apply default thresholds to groups of devices. Allow "one off" exceptions to these thresholds.  e.g. all file systems must be less than 90% full.  For serverX /opt must be less than 94% full since it currently is at 93% and should not change.


text:
Biblical Studies/Christianity/Christian music

Audio
 * [[Media:Amazing.ogg|Amazing Grace midi]] [[Image:ltspkr.png]]
 * An instrumental representation of the slave ship origins (1779) of this famous hymn by the Englishman, John Newton (1725-1807).

 * O Virgin Pure or Agni Parthene is an Orthodox Christian song

For further reading

 * Writing Effective Praise & Worship Songs
 * Music Theory/Hymn


text:
Talk:Rebol Programming

Change Log
Since this wiki is shared with every other book under the sun, it is not clear how to see where new sections have been started. Make an entry here for new works so others can check it out.

 * started on control structures, and on databases - Graham.
 * Carl did a section on /Dialects
 * Moved Language Features under TOC - Henrik
 * Moved Design Guide under TOC - Henrik
 * Doing a lot of work on PARSE under Language Features - Henrik

Requests
What should be in the book? You can find those section by hunting them, but gather them here for easier reference.

 * Linux library dependence during installation.

Size of Programming Section
The Programming chapter is likely to end up getting big (huge maybe). Should it be broken into new chapters now, or later? What's your suggested structure? G.

Post your solution here.

Design Guide
The Design Guide is very clear on many things, but is "stuck" behind the main programming guide. It will feel like all the best advice won't come until after you've spent time studying the language. - Henrik

Post your solution here.

Console
Carl says "Command Shell". The book says "Console". - Henrik

Post your solution here.

Function Writing Style
Some places functions are written as func, in other places as FUNC. - Henrik

Post your solution here.

Other documentation uses the FUNC form, but I think, that the func form is better. Moreover, it is requested by some readers. I propose to use this rule for other Rebol values like true, none, etc. When we are at it, I think, that we should write blocks with outer whitespace, but without inner whitespace, i.e.   [1 2] [3 4] , and not [ 1 2 ][ 3 4 ] Another suggestion is to emphasize text like this - Ladislav

I've begun purging the inner-space-in-blocks style, though I'm still writing emphasized text both in bold and italic.

 * Italic for something semi-important to underline a point
 * Bold for something very important that could result in code loss if attempted.

I think it catches the eye easier and doesn't blend too much with using bold for values. - Henrik

Code Coloring
Not syntax coloring, but code coloring in the examples. I haven't studied whether it's hard or easy to do, but sometimes it can be nice to point out a word in a section of code with color, to let the viewer easier see what we are doing. - Henrik

Post your solution here.

Printing
The Wikibook is hard to print, since we have to print each chapter on its own. It would also be nice to get the size of the book at regular intervals. - Henrik

Post your solution here.

My solution is to use REBOL to pull down all the pages in the order you want, and print them out Graham.Chiu

title: Talk:Rebol Programming


text:
Template:Domain-specific languages bookshelf

Domain-specific languages T EXT P ROCESSING  – AWK – Regular Expressions — M ARKUP  – CSS – HTML – XHTML – XForms – XML: Managing Data Exchange — C ONFIGURATION M ANAGEMENT  – Ant- — T YPESETTING  – LaTeX – PostScript FAQ – TeX — H ARDWARE P ROGRAMMING  – Programmable Logic — D ATABASE  – MySQL – SQL – XQuery All Domain-specific language books...


text:
MediaWiki:Nolicense

None selected (add license manually)

title: MediaWiki:Nolicense


text:
File:TLEIS1.jpg

Taskbar

title: File:TLEIS1.jpg


text:
Talk:Visual Basic/The Language

Most of the content of this pages (all of conditionals) has been split and moved to Branching and Loops. Turn this page into an appendix linked from the Programming table.

Vandalism
66.66.38.185 vandalised this page over and over again.

Probably simplest to delete the page. --kwhitefoot 11:00, 13 October 2005 (UTC)

Multiple variables in one Dim statment defaults to variant?
The text suggests that "Dim anumber, anothernumber, yetanothernumber As Integer" would cause anumber, anothernumber to be declared as variants (something I used to believe as well). As far as a I can see from Microsoft documentation this is not so (I would have quoted it, but I guess that might not be allowed). The examples given, also demonstrate that is is a valid way of typing multiple variables. The documentation was found here: http://msdn2.microsoft.com/en-us/library/7ee5a7s1.aspx (look in Data Type Rules, last bullet before the second code block). -- Baard

 * I'm afraid you have been misled by Microsoft's obfuscatory methods of writing documentation. The document you refer to treats VB.NET not VB Classic.  Microsoft appear to be suppressing the documentation for VB Classic in the hope that it will go away.  You can demonstrate what actually happens by this little program:

Option Explicit Public Sub main Dim anumber, anothernumber, yetanothernumber As Integer Dim v As Variant Debug.Print TypeName(anumber), VarType(anumber), _ TypeName(anothernumber), VarType(anothernumber), _ TypeName(yetanothernumber), VarType(yetanothernumber) Debug.Print TypeName(anumber), VarType(v) Debug.Print "Assign a number to anumber" anumber = 1 Debug.Print TypeName(anumber), VarType(anumber) Debug.Print "Assign a string to anumber" anumber = "a string" Debug.Print TypeName(anumber), VarType(anumber) End Sub

The result is:

Empty         0            Empty          0            Integer        2 Empty         0 Assign a number to anumber Integer       2 Assign a string to anumber String        8

Notice that both VarType and TypeName return information about the variable stored inside the Variant not the Variant itself.

Thanks for the comment, it drove me to add an explanatory piece of code to the page. Don't hesitate to add more comments, questions, improvements and so on. Welcome to Wikibooks! --kwhitefoot 07:26, 22 May 2006 (UTC)

 * Thank you for the example. Most of the time I’m fairly happy with Microsoft’s documentation practices, but I have to agree with you that it didn’t come across too clearly that it was a question of VB .Net in this instance.

 * When I searched msdn for the Dim statement, I got several hits (of cource). Hit 2 and 3 had the following titles “Dim Statement (Visual Basic .NET)” and ”Dim Statement (Visual Basic)”. As I chose the latter one I felt quite confident that it was not the .Net version.
 * --Baard 17:53, 22 May 2006 (UTC)

title: Talk:Visual Basic/The Language


text:
Talk:Electronics/VLF-reception with the PC

The license type of the pictures is the same as in the German version! If the license type is not known, than take them of the German version!

This seems to be quite a nice article, except that the grammar is so horrible I don't want to read it for fear of fucking up my brain cells forever. Dude, why are those Russians soooo bad at English ? Should we blame this one on communism too ? Maybe they are just unashamed of writing long stuff in languages they don't master ? --81.57.79.249 08:41, 12 June 2006 (UTC)

 * Criticism is one thing but why not offer to assist in correcting the grammar I found the article interesting Alankroeger 18:52, 20 January 2007 (UTC)

Please elaborate on the connection of the aerial to the sound card input.
How, specifically was the aerial connected to the sound card input? Was there any connection to ground?


text:
Talk:Electronics/Gallery of VLF-signals

The license type of the pictures is the same as in the German version! If the license type is not known, than take them of the German version!

I suggest somehow changing the location of those really really long pictures.

title: Talk:Electronics/Gallery of VLF-signals


text:
User:Chessprodigyman

A very boring and bored guy who isn't really all that good in chess.

title: User:Chessprodigyman


text:
Talk:New Zealand Economics

This typifies why economists and academics should be the last people anyone should listen to when considering how a 'society' functions in a changing world. Put away the text books and the dictionary and go for a walk in the sunshine...try to get some real life experiences to talk about.

It would be interesting as this book develops to do a comparison with the Australian and Singaporean economies and their management over similar time periods. The per-capita GDP (PPP) US$ figures in 2005 are: Australia, $30,900; Singapore $28,370; New Zealand $24,800, source: World Development Report 2007, IMF. Policies and resource endowments may have contributed these differences.
 * I agree, it would be. We'd need someone with knowledge of those two economies to provide the same kind of economic history I've provided for NZ though ('cos I certainly don't know! :) ). kabl00ey (talk) 19:21, 23 March 2009 (UTC)

title: Talk:New Zealand Economics


text:
Talk:Using Firefox/Plug-ins

Linux/Mac
There needs to be information about installing plugins for mac and linux. I'm not too sure about some sources I've seen (they seem outdated). Perhaps someone with experience will be better suited in contributing this section.

title: Talk:Using Firefox/Plug-ins


text:
Dialectical Behavioral Therapy/Distress Tolerance Skills/Distracting

Distress Tolerance Skills: IMPROVE the moment

Imagery

Use imagery to distract, soothe, bolster courage, and improve confidence. Imagery can make future rewards more salient (a leap of faith). Using imagery, you can create a situation different from the actual one; so, it is like leaving the situation. With imagery, you can go to a place that is safe and secure. Going to an imaginary safe place or room within can be very helpful during flashbacks. For it to be useful, you have to practice this in advance. Your ability to conjure this place must be solid if you are going to use imagery in a crisis. Practice imaging your safe place (when you are not in a crisis) enough times to get it firmly in mind and learned as a skill. An over-learned skill is available under stress.

Meaning

Finding or creating meaning helps many people in crises. Meaning answers the question why? For example, I’m doing this for the good of my family. Problems in life are opportunities to practice skills, this is the idea behind the phrase, “when life gives you lemons, make lemonade.” Suffering, when accepted, enhances empathy, and those who have suffered can reach out and help others.

Prayer

The essence of prayer is the complete opening of oneself to the moment. Ask for strength from a higher power to bear the pain in this moment.

Relaxation

Relaxing changes how the body responds to stress and crises. This skill, like imagery, takes practice. In crisis, some people tense their muscles as if to control the situation by controlling their body. The goal is to accept reality with the body. The body communicates relaxation to the mind promoting psychological acceptance.

One thing at a time

Focusing on one thing in a stressful situation can provide a means to settle down. One-mindfully often has a calming effect. The only pain one has to survive is “just this moment.” Notice how much discomfort increases by ruminating about past stressors or worrying about future problems. Let go of the future and the past. When feeling discomfort, irritation, or anxiety, tell yourself to focus on “just this moment.”

Vacation

Everyone needs a vacation from adulthood occasionally. Plan a timeout to regroup (planning is key to remaining in control and use vacations appropriately). Make it brief, and don’t choose an inappropriate time.

Encouragement

Talk to yourself the way you would talk to someone you care about who is in crisis. Talk to yourself the way you would like others to talk to you.


text:
Dialectical Behavioral Therapy/Distress Tolerance Skills/Self-soothing

SELF-SOOTHE

A way to remember these skills is to think of soothing each of your

FIVE SENSES

Vision 		Notice what you see, find soothing things to look at.

Notice the play of light on a clean wall. Enjoy the richness of colors in the floor tile. Look out the window and watch the grass gently blow in the breeze, the sun dancing on leaves, the graceful movement of the birds, or the smooth movement of passing cars. Close your eyes and notice the textures and light colors behind your eyelids.

Hearing		Pay attention to what you can hear around you.

Listen to beautiful or soothing music, or to invigorating and exciting music. Pay at¬tention to sounds of nature (waves, birds, rainfall, leaves rustling). Sing to your favorite songs. Hum a soothing tune. Learn to play an instrument. Be mindful of any sounds that come your way, letting them go in one ear and out the other. Notice how sounds on the unit feel different at various times of day. Quietly notice the sounds of your own breath. See if you can hear the sound of your own circulation.

Smell			Be aware of the memories that smell can bring.

Notice the scent of your soap and shampoo while showering. Try to find brands of deodorant, lotion, and other things that have a soothing smell to you. Sit quietly for a few minutes and try to identify all of the smells that you notice. Enjoy the smell of your meals while you are in the dining room. See if you can smell each type of food individually. Savor the smell of popcorn and remember other times in your life when you have enjoyed popcorn.

Taste			Carefully savor flavors that the day brings you.

Have a good meal; enjoy your dessert; have a favorite soothing drink such as herbal tea or hot choco¬late. Treat yourself to a favorite snack from the canteen. Suck on a piece of peppermint candy. Chew your favorite gum. Really taste the food you eat; eat one thing mindfully.

Touch				Find comfort in touch.

Take a bubble bath. Savor the feeling of crisp, clean sheets on the bed. Soak your feet. Soften your skin with lotion. Put a cold compress on your forehead. Brush your hair for a long time. Place your hand on a smooth, cool surface. Enjoy the feeling of a favorite piece of clothing, or clean clothes. Notice the comforting warmth of clothing that is fresh from the dryer. Experience whatever you are touching; notice touch that is soothing.


text:
Dialectical Behavioral Therapy/Distress Tolerance Skills/Improving the moment

Distress Tolerance Skills: IMPROVE the moment

Imagery

Use imagery to distract, soothe, bolster courage, and improve confidence. Imagery can make future rewards more salient (a leap of faith).

Using imagery, you can create a situation different from the actual one; so, it is like leaving the situation. With imagery, you can go to a place that is safe and secure. Going to an imaginary safe place or room within can be very helpful during flashbacks. For it to be useful, you have to practice this in advance. Your ability to conjure this place must be solid if you are going to use imagery in a crisis. Practice imaging your safe place (when you are not in a crisis) enough times to get it firmly in mind and learned as a skill. An over-learned skill is available under stress.

Meaning

Finding or creating meaning helps many people in crises. Meaning answers the question why? For example, I’m doing this for the good of my family. Problems in life are opportunities to practice skills, this is the idea behind the phrase, “when life gives you lemons, make lemonade.” Suffering, when accepted, enhances empathy, and those who have suffered can reach out and help others.

Prayer

The essence of prayer is the complete opening of oneself to the moment. Ask for strength from a higher power to bear the pain in this moment.

Relaxation

Relaxing changes how the body responds to stress and crises. This skill, like imagery, takes practice. In crisis, some people tense their muscles as if to control the situation by controlling their body. The goal is to accept reality with the body. The body communicates relaxation to the mind promoting psychological acceptance.

One thing at a time

Focusing on one thing in a stressful situation can provide a means to settle down. One-mindfully often has a calming effect.

The only pain one has to survive is “just this moment.” Notice how much discomfort increases by ruminating about past stressors or worrying about future problems. Let go of the future and the past. When feeling discomfort, irritation, or anxiety, tell yourself to focus on “just this moment.”

Vacation

Everyone needs a vacation from adulthood occasionally. Plan a timeout to regroup (planning is key to remaining in control and use vacations appropriately). Make it brief, and don’t choose an inappropriate time.

Encouragement

Talk to yourself the way you would talk to someone you care about who is in crisis. Talk to yourself the way you would like others to talk to you.


text:
Dialectical Behavioral Therapy/Distress Tolerance Skills/Thinking of pros and cons

Pros & cons is the skill thinking of advantages and disadvantages of a particular course of action (or doing certain things). Think about the advantages of doing things and the disadvantages of doing them. Then, think about the advantages of not doing things and the disadvantages of not doing things.


text:
Dialectical Behavioral Therapy/Distress Tolerance Skills/Radical Acceptance

Radical Acceptance

Freedom from /suffering/ requires ACCEPTANCE from deep within of what is. Let yourself go completely with what is. Let go of fighting reality.

ACCEPTANCE is the only way out of hell.

Pain creates /suffering/ only when you refuse to ACCEPT the pain.

Deciding to tolerate the moment is ACCEPTANCE.

ACCEPTANCE is acknowledging what is.

To ACCEPT something is not the same as judging it good.


text:
Dialectical Behavioral Therapy/Distress Tolerance Skills/Turning the mind

Turning the Mind

Acceptance of reality as it is requires an act of CHOICE. It is like coming to a fork in the road. You have to turn your mind toward the acceptance road and away from the “rejecting reality” road.

You have to make an inner COMMITMENT to accept.

The COMMITMENT to accept does not itself equal acceptance. It just turns you toward the path.

You have to turn your mind and commit to acceptance OVER AND OVER AND OVER again. Sometimes, you have to make the commitment many times in the space of a few minutes.


text:
Talk:A-level Physics/Forces, Fields and Energy/Further dynamics

Specification
From the OCR GCE Physics A specification. Tick with ✔ when you feel each part of the specification has been covered. Try not to add much more than what is in this list as it would not appear in the exam anyway. Use links to wikipedia for more depth in a topic.

 * 1) State each of Newton’s laws of motion. ✔
 * 2) Define, recall and use (linear) momentum as the product of mass and velocity. ✔
 * 3) Define force as rate of change of momentum, and use this definition in situations where mass is constant.
 * 4) State the principle of conservation of momentum. ✔
 * 5) Use the principle of conservation of momentum in simple applications including elastic and inelastic interactions between two bodies in one dimension, and the separation of an initially stationery object into two parts. (Knowledge of the concept of restitution is not required.)

Elastic and inelastic collisions
It would be helpful to include brief comments about elastic and inelastic collisions here, particularly with reference to the non-conservaton of kinetic energy in inelastic collisions which confuses some of my pupils.


text:
Prolog/Definite Clause Grammars

Prolog has a mechanism for defining certain grammars called Definite Clause Grammar notation. This makes it easy to write parsers. Note that while DCG syntax is part of the ISO standard, DCG semantics are not.

Grammar rules can be written in the form:

head --> body

For example:

sentence --> noun_phrase, verb_phrase.

Which will be translated to:

sentence(L0,LREMAINDER):- noun_phrase(L0,L1),verb_phrase(L1,LREMAINDER).

It means, that the  clause will receive   as input, and after parsing from a sentence from , it will give back. Let's assume that your start symbol is sentence. Then  is expected to be   after a successful parsing. The interpretation of the body of this clause is: if we parse a  and a   from our sentence, we will get back an empty list.

You can also call prolog predicates using braces.

Example
An example DCG program, which can parse numbers:

number --> digit, number_remaining. number_remaining --> dot,number_remaining. number_remaining --> digit,number_remaining. number_remaining([],[]). dot -->[0'.]. digit --> [J], {digit_code(J)}. digit_code(J):- J >= 0'0, J =< 0'9.

Note:  means the character 9 (or more precisely, the character code of 9, because there's no distinct character datatype in SWI).

If you try to consult this program, you might get a warning, because we redefined the built-in  predicate.

Running the program:

?- number("120",L). L = [] ; fail.

We get back one "result": it means that the parsing wasn't ambiguous. (There's only one possible parsing tree of the input.)

One of the earlier examples,, can be written using DCG:

revappend([]) --> []. revappend([X|Xs]) --> revappend(Xs), [X].

title: Prolog/Definite Clause Grammars


text:
Wikijunior:Ancient Civilizations/Mound Builders

Where did they live?
The "Mound Builders" lived in what is today the eastern half of the United States and southern Canada, in North America.

Because the people who lived in these societies did not leave any written records, archaeologists look for similarities and differences between the mounds, and figure out which groups of Mound Builders interacted with each other.

What did their buildings look like?

The name for this society comes from the fact that they left large earthen mounds behind in what appears to be community centers of activity. Many of these earthen mounds have been removed by modern peoples in North America, but they were found in many of the same locations where current cities in the United States are now located. They also lived in Spiro which is now present day Oklahoma.

A major feature of most villages was a trading area where items could be exchanged for items that were made in places much more distant. It is known that these trading networks were quite large, and they may have even had contact with other major civilizations in North America like the Aztecs. Items such as obsidian knives have been found over 1000 miles from any known source of volcanic rock.

Often within these mounds, particularly some of the larger mounds, there have been the remains of what is assumed to be a major chief or king, based on the items that are found buried with the person. This was also a reason for why many of these mounds have disappeared, because early treasure hunters would dig through these mounds trying to find gold, silver, or other precious stones and jewelry.

When did they live there?

 * Early Woodland - Adena in Ohio, others in Illinois, Kentucky, West Virginia
 * Middle Woodland - Hopewell in Ohio, others in Illinois, Indiana, Missouri, Kentucky
 * Late Woodland - Effigy Mounds in Iowa, Illinois, Wisconsin, Michigan, and Minnesota
 * Mississippian - Cahokia Mounds in Illinois, Spiro Mounds in Oklahoma

What did they eat?
They ate a wide variety of food items, depending on where they were living. Corn (maize) was brought into the area from Mexico and was widely grown together with other vegetables like beans and squash. They also hunted both small animals like rabbits and squirrels and larger game animals like bison and various types of deer. In some lake regions, they ate wild rice, and also ate fish either from the ocean or from freshwater lakes and rivers. They dried many foods to eat in the winter. And they also drank water from freshwater rivers.

What did they wear?
It is not completely clear how they dressed. If you look at the traditional clothing of their descendants, it was probably simple clothing made for protection from the weather. Their clothing was probably made mostly from animal skins. It may have also included plant fibers, and might have been colored with plant-based dyes.

What did their writing look like?
As far as we know, the Mound Builders never invented written language with an alphabet. There are, however, images which have been carved into rocks and in caves, as well as inscribed onto everyday objects like pottery. These can be found throughout North America. These images are called petroglyphs.

Often these symbols were arranged to tell a story, or note something of significance to the people who drew these symbols. Usually these symbols would be used to remind a tribal elder about a story that would then be passed on to the next generation, and unless that oral history has been preserved, the story is usually lost

The ceremonial masks, jewelry, and artifacts come from a wide range of places. The Hopewell mounds had copper from Lake Superior, mica from North Carolina, and shells from the Gulf Coast. This might show that the beliefs were held in a wide area, or it might only show that the Mound Builders traded over a wide area.

The first evidence of humans burying the dead comes from the Mound Builders.

Are some of them famous even today?
We don't know the name of a single Mound Builder. Because the Mound Builders did not use writing, no names are known today. But we are still researching them, hopefully we will find names.

What happened to them?

 * There is some evidence (war, abandonment of some towns for small, stockaded settlements) that the civilization was in decline before the conquistadors arrived in Central America.
 * The diseases brought by the conquistadors spread quickly through the Americas. Lots of people died from European diseases like smallpox, especially in Mississippian towns where people lived close together.
 * By the time Europeans reached the Mississippi, many of the towns were empty.

What is left of them today?

 * They spread the cultivation of corn, beans, and squashes throughout Eastern (and Central?) North America. These foods were the most important foods of many Native Americans, were important foods to the Europeans who settled the land, and are still important today.  North Americans eat a lot of corn and beans.  Some squashes (like pumpkins) are important symbols of fall and Thanksgiving in the US.

 * They left many mounds, which archeologists still study today. Some of the mounds are set aside in parks and monuments, so that people can look at the mounds, and learn from them. Some of the mounds are burial mounds, which contain ornaments. Archeologists learn how people lived and dressed from what is left in the mounds.

It is believed that they are the ancestors of several Native American Indian groups in North America.

 * The Mississippian cultures left no written records, because they did not have a writing system like we have. They could not write books.
 * culture: stories, architecture, tools, and arts of Native Americans.
 * Native American Art is known around the world today.
 * Native American folk tales
 * Native American religious beliefs

Who lives there now?
Settlers from England and Europe often built their own towns on or near abandoned mound builder towns, because they were in good locations for farming or trade. In some cases, they forced the Native Americans out before settling. Some cities that were built on or near mound builder towns are Cahokia, Illinois; Marquette, Iowa; and Chillicothe, Ohio. Now, the people who live in these places are citizens of the USA or Canada. They study the history of Europe, and of the people who built the countries of North America. Their ancestors are mostly from Europe, Africa, and Asia.

Most of the people who live on or near mound builder towns don't even know it. Now, hundreds of years later, people are beginning to study the graves, towns, and temples of the mound builders.
 * http://www.cahokiamounds.com/cahokia.html
 * http://www.nps.gov/efmo/index.htm
 * http://www.nps.gov/hocu/
 * http://www.ohiohistory.org/places/newarkearthworks/index.cfm
 * http://www.nativeamericans.com/MoundBuilders.htm
 * http://www.cr.nps.gov/archeology/feature/feature.htm
 * http://www.mississippian-artifacts.com/
 * http://ngeorgia.com/history/early.html
 * http://www.angelfire.com/wi/oneota/
 * http://mcclungmuseum.utk.edu/permex/archaeol/archaeol.htm
 * http://www.ah.dcr.state.nc.us/sections/hs/town/town.htm

Wikijunior Alte Zivilisationen/ Hügelbauer

fr:Wikijunior:Les civilisations anciennes/Les Mound Builders