text:
Using Firefox/Plug-ins

What is a Plugin?
Firefox requires plugins in order to read or display special content from the websites. Plugins are programs that are integrated into Firefox that allows websites to provide content to you. Such content includes flash videos, java games and streaming video from the Internet. Examples of plugins are Flash, RealPlayer, and Java. Plugins are a necessary component to truly access the Internet's interactive stuff.

A much more comprehensive list of plugins, with detailed installation instructions, is available at Mozilla Update. Another valuable resource is Mozdev Plugins.

What is Current Version Plugin?
Firefox plugins should be updated to latest version. Firefox plugin check page will find the latest update of plugins. Having said that, There are few plugins will be given as unknown plugins if Firefox is unable to recognize. These unknown plugins should be updated manually by finding the current version plugin in search engine. Any plugin update can be found by prefixing keyword current version plugin in search engine.

Close Firefox before installing plugins
Firefox should be closed before running any plugin installation programs, as existing files may be overwritten during the installation process.

Using XPInstall to install plugins
Some plugins are available as XPInstall packages (XPIs), the same format as that for extensions. Where XPIs are available, it is recommended you use them as they often install the plugin automatically without you having to restart Firefox. After the XPI has finished installing, you should restart your browser.

Checking which plugins you have installed
To check what plugins you have installed, simply type about:plugins in the Location bar. This page will show which plugins are installed, what file types they are associated with and if the plugin is enabled or disabled.

Adobe PDF Reader
In order to read .pdf files, you need to install a pdf reader. Adobe Reader, one of the more popular software, can do this. Simply go to Adobe's official site and download Adobe Reader. With Firefox closed, install Adobe Reader and it will also install the plugin necessary for Firefox to view PDF files. No other steps are necessary. Firefox will now open all PDFs from within a Firefox tab.

If you install Adobe Reader after Firefox, Adobe Reader will automatically select the right plugin. If you already have the latest version of Adobe Reader installed then Firefox will automatically use the plugin. Some people have problems with the Adobe Reader plugin in Firefox. The explanation and solution is here.

Java
The Java Plugin is part of the Java Runtime Environment (JRE, for short). The JRE installer will install the Java Plugin for Netscape 7.2 and Mozilla automatically.

To get the it simply go to java.com and click the "Download Now!" button to download and install the latest JRE.

Macromedia Shockwave Player
Simply go to the Macromedia Shockwave [http://sdc.shockwave.com/shockwave/download/download.cgi? site] and download the plugin. When you are installing it, Firefox will appear in the list of browsers that you can install the plugin for. (Remember, Firefox should be closed when installing).

Quicktime Player (Windows & Mac)
Simply go to Apple's (the developer of Quicktime) website and download Quicktime. Installing Quicktime will install the appropriate plugin in order for Firefox to view .mov files.

RealPlayer
Simply go to Real's (the developer of RealPlayer) website and download the program. The RealPlayer installer will automatically detect your browser's plugins folder and install the plugin.

Uninstalling Plugins
A list of your installed plugins can be obtained from about:plugins. As a general rule, to remove a plugin, you remove the file listed in about:plugins for it. Typically a .dll file.

On a XP machine this can typically be found at c:\Program Files\Mozilla Firefox\plugins

Firefox/Plug-ins Mozilla Firefox/Plug-ins

title: Using Firefox/Plug-ins


text:
Using Firefox/Keyboard shortcuts

Standard Firefox Keyboard Shortcuts

 * Note: for Mac OS X, use the Command key in place of Control for all shortcuts listed.

Firefox/Raccourcis clavier Mozilla Firefox/Scorciatoie da Tastiera Firefox/Sneltoetsen

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

title: Using Firefox/Keyboard shortcuts


text:
Using Firefox/Mouse shortcuts

 * Note: for Mac OS X, use the Command key in place of Control for all shortcuts listed.

Standard Firefox Shortcuts
Mozilla Firefox/Scorciatoie Mouse

title: Using Firefox/Mouse shortcuts


text:
Using Firefox/Advanced

about:config
In Gecko-based browsers, such as Firefox, SeaMonkey, and their derivatives, about:config is a powerful way to tweak preferences in ways that are not normally accessible through the Preferences page (earlier, the Options window).

As in the Firfeox user interface, preferences in about:config apply only to the active browser profile. Different user profiles can have different preferences; though most settings are the same across profiles.

Type about:config into the Firefox address bar, press Enter/Return, and you might first be shown a page to warn you, that these are advanced settings, and changing some of them might break how Firefox works. There is a 'Continue' button and a checkbox not to show the warning page again. After clicking the 'Continue' button, you are then taken to about:config settings.

At the top is is a search bar to allow finding the right preference by filtering the list. Copying and pasting a preference name into the search bar makes it easy to find the right one.

A user is presented with a table-based list of preferences, showing their name, status, type, and value in their respective columns. The list can be sorted in ascending and descending order by clicking on each column's header. One can move around in the list by single-clicking a setting to move cursor focus into the list, and then using the keyboard navigation keys (Up, Down; PgUp, PgDn; Home, End).

Most about:config preferences are built-in and displayed. Some preferences are hidden, and must be added by the user. Other preferences are created by an installed extension, such as NoScript.

A preference status can be one of the following:
 * default
 * modified — if changed from their default value, the entire line is shown in boldface
 * locked — shown in italics. This status is rare and is meant to prevent a preference from being trivially changed. A setting is typically locked by a Linux distribution (to prevent telemetry, for example) or by a system administrator (usually in a corporate environment).

A preference type can be one of the following:
 * a boolean — a true/false setting;
 * an integer — full numbers from 0 to something large. The numbered values can and do have different units;
 * a string — This can be any form of text or numbers, though each string of text usually has its own syntax, as required by each preference.

Changes can be made by double-clicking one of the available options, or selecting them and pressing the Return/Enter key.

That way, via double-click or Enter, the booleans are toggled, as they have only a single value of true or false, and are thus the simplest to change. Other preference types are modified, in which case an input box appears for numbers (integers) or text (strings).

Note: In some preference cases, a string type preference can contain or may require a simple integer number instead of text. Therefore, when changing a respective preference's value, pay attention to its type and documentation.

When right-clicking a preference, a context menu appears with the following commands:
 * Modify/Toggle;
 * Copy — copy the preference name and value separated by a semicolon. It is pasted as
 * Copy Name — copies only the preference name for easy pasting and searching
 * Copy Value — copies only the preference value. Very useful, if the value is a long string of text and extends well outside the display area.
 * New > — Create a new preference that is not listed: a string, integer, or a boolean.
 * Reset — resets the preference value to the default pre-set by the browser or an installed extension. This is useful, should anything go wrong.

A more complete list of about:config settings can be found here, with descriptions and which values the preference will take (where applicable).

Example preferences

 * browser.block.target_new_window — if set to true, links that normally force a new window to open will open in the current window instead.

 * browser.xul.error_pages.enabled — if set to true, Firefox displays an error page similar to IE instead of a message box if loading a page fails. This is an older and deprecated preference, as Firefox now uses error or message pages.

 * layout.frames.force_resizability — if set to true, allows the user to resize frames on any web site that uses them.

Optimise resource usage
Setting some of the settings one or another way is either imperative or recommended for memory-limited devices, such as those with 1 GB or less RAM, especially in a liveCD condition, as liveCD environments might not be able to use swap — specifically with computers that have Windows, where a Linux swap partition does not exist on the hard drive.

Computers with 1 GB RAM or less must have that setting on to reduce memory and resource consumption.

Devices with 1.5–2 GB RAM in a liveCD setting are able to handle greater resource requirements, but not by too much. At this point, the value that is imperative for 1 GB RAM, is only recommended for computers and devices with 2 GB RAM memory.

Disable media
All media functionality is disabled: this includes playback, media capture (audio and video recording), and screen sharing.

Optional, or not required, if computer RAM memory is 2 Gb or greater.

Speed up network access
The following changes can be made to speed up network access.

Usually, the preferences related to network speeds do not need to be changed, unless you know exactly what you want to do with these settings.

Changing these preferences may speed up browsing, but in most cases, the difference is negligible. Some of these settings have also been deprecated in modern Firefox versions.

General browsing speed can be improved through extensions by using an adblocker (such as Adblock Plus or uBlock Origin) and/or a scriptblocker, such as NoScript. As they variously block content, page rendering speeds improve, and network requests to advertisements and trackers are also reduced.

Pipelining
Normally, the browser will make one request to a web page at a time. When you enable pipelining, it will make several requests at a time, which usually speeds up page loading. Make these changes to enable pipelining:

Set "network.http.pipelining" to "true"

Set "network.http.proxy.pipelining" to "true"

[Tip: If your browser is set to connect to an optional http proxy, you can leave "network.http.pipelining" as "false", then add the domains of websites that do not work with pipelining (like images.google.com) to the proxy exclude list.]

Set "network.http.pipelining.maxrequests" to 8. — This means, that Firefox will make up to 8 requests at once rather than the default 4. This is only an advantage if you have a fast and reliable internet connection.

Maximum number of connections
For broadband users:

Set "network.http.max-connections-per-server" to 14. Many guides recommend setting this figure to 100, but this can have undesirable effects upon webservers.

Set "network.http.max-connections" to 48

Rendering
Right-click anywhere and select New-> Integer. Name it "nglayout.initialpaint.delay" and set its value to "0".

This preference sets the amount of time the browser waits before it acts on information it receives, but it will increase the total time taken to render the page. While this option is more suitable for a faster computer, setting the value to something low, or "0" works better with slow connections.

The default vaue is "250". Try a value of "100", if "0" causes problems.

Introduction
A user agent string (UA string) is a string of text with a specific syntax identifying the user agent — usually that of a web browser — which is sent to a website or domain when making a request to download a page or fetch information. Some other user agents are screen readers for blind people, download managers, webcrawlers, indexers, and archivers, each of which send their own unique UA string.

Some sites require specific versions of browser, or a specific browser and operating system combination in order for a web application to offer specific features, or to function at all.

For most sites, user agent strings do not require modification. Such modification is also called user agent spoofing.

There are use cases, where user agent strings do need to be more specific:
 * A particular site requires a specific browser;
 * A user wants their web client to identify as a mobile, tablet, or desktop browser for certain domains and use cases;
 * A user has a legacy browser that needs to identify itself as a newer one for certain sites;
 * A user wants their browser to have the most generic user agent for privacy purposes;
 * Conversely, some people want a very specific user agent string in order to demonstrate to sites the existence of their favourite browser, or a particular OS, or that a certain operating system version is still in use.

The latter example most often applies to people who might use a Firefox derivative (such as GNU IceCat or WaterFox), or who might use older versions of Firefox, or if their operating system is Linux, or if they use a legacy version of Android.

The reason for featuring a specific UA string is to nudge site developers to take note of which configurations visit their site, which browsers and operating systems they should keep testing against, and which they ought to keep supporting.

Thus, promoting a non-generic UA string causes these users to also have a dilemma with regard to having a privacy trade-off, because a very specific user agent string is very unique, and therefore much easier to identify for sites that use browser fingerprinting.

Comparably, the default web browser in many versions of Android even sends the device make and model in their user agent string, while the UA string of Firefox for Android typically contains less information, and has also in past cases been less accurate.

Nevertheles, desktop Firefox alone has become a minority browser — with its usage share greatly overshadowed by Google Chrome, and Firefox for Android being an even greater minority on phones and tablets. Each Firefox version is therefore more unique, and each version of a Firefox derivative even more unique.

It should be noted, though, that if they wish to do so, advanced users are usually aware of how to properly anonymise the browsing traffic that runs from their computer through the wider Internet.

 * To find out what kind of information web sites can collect about the browser you use and the device you're on, visit the Electronic Frontier Foundation's Panopticlick site at https://panopticlick.eff.org

Modifying
In desktop Firefox, changing the user agent string in about:config preferences does not work, while it works admirably in Firefox for Android.

To change the user agent string in desktop Firefox, one must use extensions.

 * UAControl is a legacy XUL extension for Firefox 56.0 and earlier. It supports user-agent spoofing for specific domains, leaving the default user agent string for all other sites, though it does not have a pre-set list of UA strings (these can be picked up from the web). UAControl requires the User-Agent JS Fixer add-on to work.
 * Custom UserAgent String is a WebExtension that is similarly versatile in employing per-domain user-agent spoofing, but has a clunky user interface. It's available for Firefox 48.0 and greater.

Editing the userChrome.css File
userChrome.css is a file that allows you to change the appearance of Firefox with CSS rules. The actual browser window (i.e., not the webpage, but everything else) is called the "chrome". The file userChrome.css overrides default settings to allow for more customization.

userChrome.css is not created by default. It should be created in your profile folder, which can be found in the following places:

Windows: %appdata%\Roaming\Mozilla\Firefox\Profiles\\ Linux: ~/.Ajay/firefox// Mac OS X: ~/Library/Ajay/Firefox/Profiles// or ~/Library/Application Support/Firefox/Profiles//

In all cases, the profile is randomly named, with 8 characters followed by .default. Inside that folder is another named "chrome". Inside the chrome folder is where userChrome.css needs to be created.

Editing the userContent.css File
The UserContent.css file allows a user to change the general appearance of web pages. This requires knowledge of Cascading Style Sheets (CSS).

Changing the web pages' appearance through this file can be relatively cumbersome, and is limited to CSS only. Using the GreaseMonkey or Stylish extensions is recommended, as each provides a user interface to doing the same things, and are therefore easier to use.

The GreaseMonkey extension is more advanced, as it allows adding JavaScript to downloaded web pages to make a webpage or site function better. With some extra effort, this also includes adorning pages with CSS.

Comparatively, Stylish allows adding only CSS-based modifications to downloaded pages, and unlike GreaseMonkey, Stylish also runs on all versions of Firefox for Android.

Note, that while these extensions only change the appearance of web pages downloaded into the browser; the extensions do not change the pages' and sites' appearance on the web server.

Tips

 * Allowing extension downloads from mozilla.org instead of www.mozilla.org will match all subdomains of mozilla.org, just as blocking cookies from doubleclick.net instead of www.doubleclick.net will allow blocking of all doubleclick.net subdomains. Allowing "www.mozilla.org" would not allow "addons.mozilla.org". However, as a security measure, when whitelisting sites for extensions, the most specific domain available should be used (i.e., addons.mozilla.org instead of mozilla.org) to prevent potentially malicious installs from other subdomains on a site.

 * To get Firefox on a computer without an internet connection, or where internet downloads are blocked, one can download the installer as normal from another computer (usually you can do this at a public library), and then put the *.exe file on some removable media and transfer it to the first computer. Another option is to download Firefox portable on a USB stick or memory card, and run the portable Firefox off external storage.

title: Using Firefox/Advanced


text:
User:Pne

Hi! I'm Philip Newton. I'm also 'Pne' on Wikipedia.

title: User:Pne


text:
MySQL/Pivot table

"pivot table" or a "crosstab report"

(Note: this page needs to be wikified)

SQL Characteristic Functions: Do it without "if", "case", or "GROUP_CONCAT". Yes, there is use for this..."if" statements sometimes cause problems when used in combination. The simple secret, and it's also why they work in almost all databases, is the following functions: Quick example:  sign(-1) = -1,  abs( sign(-1) ) = 1,  1-abs( sign(-1) ) = 0 Data for full example: CREATE TABLE exams (        pkey int(11) NOT NULL auto_increment,         name varchar(15),         exam int,         score int,         PRIMARY KEY  (pkey)       ); insert into exams (name,exam,score) values ('Bob',1,75); insert into exams (name,exam,score) values ('Bob',2,77); insert into exams (name,exam,score) values ('Bob',3,78); insert into exams (name,exam,score) values ('Bob',4,80); insert into exams (name,exam,score) values ('Sue',1,90); insert into exams (name,exam,score) values ('Sue',2,97); insert into exams (name,exam,score) values ('Sue',3,98); insert into exams (name,exam,score) values ('Sue',4,99); mysql> select * from exams; +--+--+--+---+ | pkey | name | exam | score | +--+--+--+---+ |   1 | Bob  |    1 |    75 | |   2 | Bob  |    2 |    77 | |   3 | Bob  |    3 |    78 | |   4 | Bob  |    4 |    80 | |   5 | Sue  |    1 |    90 | |   6 | Sue  |    2 |    97 | |   7 | Sue  |    3 |    98 | |   8 | Sue  |    4 |    99 | +--+--+--+---+ 8 rows in set (0.00 sec) mysql> select name, sum(score*(1-abs(sign(exam-1)))) as exam1, sum(score*(1-abs(sign(exam-2)))) as exam2, sum(score*(1-abs(sign(exam-3)))) as exam3, sum(score*(1-abs(sign(exam-4)))) as exam4 from exams group by name; +--+---+---+---+---+ | name | exam1 | exam2 | exam3 | exam4 | +--+---+---+---+---+ | Bob |    75 |    77 |    78 |    80 | | Sue |    90 |    97 |    98 |    99 | +--+---+---+---+---+ 2 rows in set (0.00 sec) Note, the above pivot table was created with one select statement. Let's decompose to make the trick clearer, for the second exam: mysql> select name, score, exam, exam-2, sign(exam-2), abs(sign(exam-2)), 1-abs(sign(exam-2)), score*(1-abs(sign(exam-2))) as exam2 from exams; +--+---+--++--+---+-+---+ | name | score | exam | exam-2 | sign(exam-2) | abs(sign(exam-2)) | 1-abs(sign(exam-2)) | exam2 | +--+---+--++--+---+-+---+ | Bob |    75 |    1 |     -1 |           -1 |                 1 |                   0 |     0 | | Bob |    77 |    2 |      0 |            0 |                 0 |                   1 |    77 | | Bob |    78 |    3 |      1 |            1 |                 1 |                   0 |     0 | | Bob |    80 |    4 |      2 |            1 |                 1 |                   0 |     0 | | Sue |    90 |    1 |     -1 |           -1 |                 1 |                   0 |     0 | | Sue |    97 |    2 |      0 |            0 |                 0 |                   1 |    97 | | Sue |    98 |    3 |      1 |            1 |                 1 |                   0 |     0 | | Sue |    99 |    4 |      2 |            1 |                 1 |                   0 |     0 | +--+---+--++--+---+-+---+ 8 rows in set (0.00 sec) You may think IF's would be clean but WATCH OUT! Look what the following gives (INCORRECT !!): mysql> select name, if(exam=1,score,null) as exam1, if(exam=2,score,null) as exam2, if(exam=3,score,null) as exam3, if(exam=4,score,null) as exam4 from exams group by name; +--+---+---+---+---+ | name | exam1 | exam2 | exam3 | exam4 | +--+---+---+---+---+ | Bob |    75 |  NULL |  NULL |  NULL | | Sue |    90 |  NULL |  NULL |  NULL | +--+---+---+---+---+ 2 rows in set (0.00 sec) Note: the following does work - is all the maths necessary after all? mysql> SELECT name, SUM(IF(exam=1,score,NULL)) AS exam1, SUM(IF(exam=2,score,NULL)) AS exam2, SUM(IF(exam=3,score,NULL)) AS exam3, SUM(IF(exam=4,score,0)) AS exam4 FROM exams GROUP BY name; +--+---+---+---+---+ | name | exam1 | exam2 | exam3 | exam4 | +--+---+---+---+---+ | Bob |    75 |    77 |    78 |    80 | | Sue |    90 |    97 |    98 |    99 | +--+---+---+---+---+ 2 rows in set (0.00 sec) mysql> select name, sum(score*(1-abs(sign(exam-1)))) as exam1, sum(score*(1-abs(sign(exam-2)))) as exam2, sum(score*(1-abs(sign(exam-3)))) as exam3, sum(score*(1-abs(sign(exam-4)))) as exam4, sum(score*(1-abs(sign(exam- 2)))) -  sum(score*(1-abs(sign(exam- 1)))) as delta_1_2, sum(score*(1-abs(sign(exam- 3)))) -  sum(score*(1-abs(sign(exam- 2)))) as delta_2_3, sum(score*(1-abs(sign(exam- 4)))) -  sum(score*(1-abs(sign(exam- 3)))) as delta_3_4 from exams group by name; +--+---+---+---+---+---+---+---+ | name | exam1 | exam2 | exam3 | exam4 | delta_1_2 | delta_2_3 | delta_3_4 | +--+---+---+---+---+---+---+---+ | Bob |    75 |    77 |    78 |    80 |         2 |         1 |         2 | | Sue |    90 |    97 |    98 |    99 |         7 |         1 |         1 | +--+---+---+---+---+---+---+---+ 2 rows in set (0.00 sec) Above delta_1_2 shows the difference between the first and second exams, with the numbers being positive because both Bob and Sue improved their score with each exam. Calculating the deltas here shows it's possible to compare two rows, not columns which is easily done with the standard SQL statements but  rows in the original table. mysql>select name, sum(score*(1-abs(sign(exam-1)))) as exam1, sum(score*(1-abs(sign(exam-2)))) as exam2, sum(score*(1-abs(sign(exam-3)))) as exam3, sum(score*(1-abs(sign(exam-4)))) as exam4, sum(score*(1-abs(sign(exam- 2)))) -  sum(score*(1-abs(sign(exam- 1)))) as delta_1_2, sum(score*(1-abs(sign(exam- 3)))) -  sum(score*(1-abs(sign(exam- 2)))) as delta_2_3, sum(score*(1-abs(sign(exam- 4)))) -  sum(score*(1-abs(sign(exam- 3)))) as delta_3_4, sum(score*(1-abs(sign(exam- 2)))) -  sum(score*(1-abs(sign(exam- 1))))  + sum(score*(1-abs(sign(exam- 3)))) -  sum(score*(1-abs(sign(exam- 2))))  + sum(score*(1-abs(sign(exam- 4)))) -  sum(score*(1-abs(sign(exam- 3))))  as TotalIncPoints from exams group by name; +--+---+---+---+---+---+---+---++ | name | exam1 | exam2 | exam3 | exam4 | delta_1_2 | delta_2_3 | delta_3_4 | TotalIncPoints | +--+---+---+---+---+---+---+---++ | Bob |    75 |    77 |    78 |    80 |         2 |         1 |         2 |              5 | | Sue |    90 |    97 |    98 |    99 |         7 |         1 |         1 |              9 | +--+---+---+---+---+---+---+---++ 2 rows in set (0.00 sec) TotalIncPoints shows the sum of the deltas. select name, sum(score*(1-abs(sign(exam-1)))) as exam1, sum(score*(1-abs(sign(exam-2)))) as exam2, sum(score*(1-abs(sign(exam-3)))) as exam3, sum(score*(1-abs(sign(exam-4)))) as exam4, sum(score*(1-abs(sign(exam- 2)))) -  sum(score*(1-abs(sign(exam- 1)))) as delta_1_2, sum(score*(1-abs(sign(exam- 3)))) -  sum(score*(1-abs(sign(exam- 2)))) as delta_2_3, sum(score*(1-abs(sign(exam- 4)))) -  sum(score*(1-abs(sign(exam- 3)))) as delta_3_4, sum(score*(1-abs(sign(exam- 2)))) -  sum(score*(1-abs(sign(exam- 1))))  + sum(score*(1-abs(sign(exam- 3)))) -  sum(score*(1-abs(sign(exam- 2))))  + sum(score*(1-abs(sign(exam- 4)))) -  sum(score*(1-abs(sign(exam- 3))))  as TotalIncPoints, (sum(score*(1-abs(sign(exam-1)))) + sum(score*(1-abs(sign(exam-2)))) + sum(score*(1-abs(sign(exam-3)))) + sum(score*(1-abs(sign(exam-4)))))/4 as AVG from exams group by name; +--+---+---+---+---+---+---+---++---+ | name | exam1 | exam2 | exam3 | exam4 | delta_1_2 | delta_2_3 | delta_3_4 | TotalIncPoints | AVG  | +--+---+---+---+---+---+---+---++---+ | Bob |    75 |    77 |    78 |    80 |         2 |         1 |         2 |              5 | 77.50 | | Sue |    90 |    97 |    98 |    99 |         7 |         1 |         1 |              9 | 96.00 | +--+---+---+---+---+---+---+---++---+ 2 rows in set (0.00 sec) It's possible to combine Total Increasing Point TotalIncPoints with AVG. In fact, it's possible to combine all of the example cuts of the data into one SQL statement, which provides additional options for displaying data on your page select name, sum(score*(1-abs(sign(exam-1)))) as exam1, sum(score*(1-abs(sign(exam-2)))) as exam2, sum(score*(1-abs(sign(exam-3)))) as exam3, sum(score*(1-abs(sign(exam-4)))) as exam4, (sum(score*(1-abs(sign(exam-1)))) + sum(score*(1-abs(sign(exam-2)))))/2 as AVG1_2, (sum(score*(1-abs(sign(exam-2)))) + sum(score*(1-abs(sign(exam-3)))))/2 as AVG2_3, (sum(score*(1-abs(sign(exam-3)))) + sum(score*(1-abs(sign(exam-4)))))/2 as AVG3_4, (sum(score*(1-abs(sign(exam-1)))) + sum(score*(1-abs(sign(exam-2)))) + sum(score*(1-abs(sign(exam-3)))) + sum(score*(1-abs(sign(exam-4)))))/4 as AVG from exams group by name; +--+---+---+---+---++++---+ | name | exam1 | exam2 | exam3 | exam4 | AVG1_2 | AVG2_3 | AVG3_4 | AVG  | +--+---+---+---+---++++---+ | Bob |    75 |    77 |    78 |    80 |  76.00 |  77.50 |  79.00 | 77.50 | | Sue |    90 |    97 |    98 |    99 |  93.50 |  97.50 |  98.50 | 96.00 | +--+---+---+---+---++++---+ 2 rows in set (0.00 sec) Exam scores are listing along with moving averages...again it's all with one select statement.
 * sign (x) returns -1,0, +1 for values x < 0, x = 0, x > 0 respectively
 * abs( sign( x) ) returns 0 if x = 0  else, 1 if  x > 0 or x < 0
 * 1-abs( sign( x) ) complement of the above, since this returns 1 only if x = 0

Good article on "Cross tabulations" or de-normalizing data to show stats: http://dev.mysql.com/tech-resources/articles/wizard/print_version.html

ADOdb (PHP) can generate pivot tables using.

For Perl, check DBIx-SQLCrosstab.

title: MySQL/Pivot table


text:
Home Remedies

Contents

 * Chapter 1: Introduction - Introduction to the basics, some history on the origins of some of the most popular home remedies, and why home remedies are an effective way to treat common ailments.
 * Chapter 2: The Common Cold and Other Infections - Grandma's chicken soup isn't as useless as originally thought.
 * Chapter 3: Nausea, Headaches, and Other Everyday Ailments - Including common causes and methods of prevention.
 * Chapter 4: Acne, Warts and Other Skin Problems - Solutions to common skin problems.
 * Chapter 5: Sprains, Sores, and Cuts - Heal faster, better, and safer.
 * Chapter 6: Bites and Stings - Tell those bugs to hit the road and treat what they leave behind.

title: Home Remedies


text:
Talk:XML - Managing Data Exchange/SMIL

Why not mention commercial software!??
In the article, it says: "Given that WikiBooks is a publicly-available 'open' book, it would be inappropriate to include information about or links to any commercial SMIL tools." - I don't see why this wikiBook should not mention commercial software! There are other books on wikibooks.org dedicated to commercial software such as the wikibook on Oracle or Microsoft_SQL_Server_2005

Why Netbeans only ?
There are a lot of XML editors, but in this book Netbeans is a special case, letting the reader think that Netbeans would be better than any other XML Editor available. I guess this is wrong, any XML Editor, given that it provides comprehensive functionnality, would be equal to Netbeans in this regard.

title: Talk:XML - Managing Data Exchange/SMIL


text:
A-level Mathematics/OCR/C1/Polynomials

You are already familiar with expressions such as $$3x+5$$ or $$2x^2 + 8x + 2$$ and perhaps $$x^3 + 2x - 2$$. The general word for an expression that can be written in this form is a polynomial. Excluding the constant term, every power of $$x$$ in a polynomial is a positive integer. Expressions that have $$x$$ to a non-integer or negative power are not polynomials.

Basics of polynomials
All polynomials can be written in the form:

$$a_0 + a_1x + a_2x^2 + a_3x^3 + a_4x^4\dots a_nx^n$$.

The numbers $$a_0,a_1,a_2,a_3,a_4\dots$$ are known as the co-efficients, and will often already be known. For example in $$4x^2 + 3x + 9$$ the coefficient of $$x^2$$ is 4. The co-efficients may be 1 or even 0, for example $$x^3 + x$$ is still a polynomial.

Degrees of polynomials
The number $$n$$, i.e. the highest power in the polynomial is known as the degree, or sometimes the order, of the polynomial. For example, $$x^4 + 4x^2 + 9$$ is a degree 4 polynomial. Certain degrees have names, and are often written using certain letters for the coefficients when they are unknown:

 * Degree 0 - Constant - $$c$$ or $$k$$
 * Degree 1 - Linear - $$ax + b$$ or $$mx + c$$
 * Degree 2 - Quadratic - $$ax^2 + bx + c$$
 * Degree 3 - Cubic - $$ax^3 + bx^2 + cx + d$$
 * Degree 4 - Quartic $$ax^4 + bx^3 + cx^2 + dx +e$$

Notation
Most of the polynomials on this page are written in terms of $$x$$, for example, $$4x^2 + 2x - 9$$, although polynomials can be written with other letters. $$3z^2 + z - 2$$, for example, is called a polynomial in $$z$$.

It is conventional to write polynomials in descending powers for clarity, although a polynomial may have the powers in any order. By writing polynomials in descending powers it is possible to see what the degree of the polynomial is simply by looking at the first term. Performing operations with two or more polynomials are also much simpler when the powers are in order, since like powers are usually grouped during calculations.

Indeed, you may lose marks in your exam if you don't simplify things like $$x^2 + 5x - 3x$$ to $$x^2 + 2x$$.

Addition
To add polynomials you simply add the co-efficients of each term. If that sounds confusing don't worry as you will probably already know how to do this, it is basically the same as collecting like terms. You add the co-efficients of $$x$$ together, the co-efficients of $$x^2$$ together, and so on. For example:

$$\left(4x^2 + 2x + 9\right) + \left(6x^2 - 2\right) = 10x^2 + 2x + 7$$

Notice that $$4+6=10$$ and $$9-2=7$$. Some find it helpful to write this out like numerical addition: When using this method it is essential that terms with $$x$$ to the same power are lined up, leaving spaces if necessary as in the example above.

Subtraction
For subtraction of polynomials, it is possible to use the same method as above, except subtracting instead of adding. It may get confusing when there are negative terms involved, so it is preferred to reverse the signs in the second row and then add the two polynomials together.

This:

Would become this:

This method is desirable in the exam because subtracting negative numbers may cause confusion, and mistakes may be overlooked in the pressure of the exam.

Multiplication
To multiply polynomials you simply multiply all the terms in one by all the terms in the other and then sum the results. This method is known as the FOIL Method. It stands for First Outer Inner Last. For example:

$$\left(3x^2+2x\right) \times \left(2x^2 - 5\right)$$ can be broken down into:

Multiply the First terms together.

$$3x^2 \times 2x^2 = 6x^4$$

Then multiply the Outer terms together.

$$3x^2 \times -5 = -15x^2$$

Then multiply the Inner terms together.

$$2x \times 2x^2 = 4x^3$$

Then multiply the Last terms together.

$$2x \times -5 = -10x$$

Then we add the results together to give us $$6x^4 + 4x^3 - 15x^2 - 10x$$, written in descending powers.

As you become confident with the process, you'll be able to do the entire multiplication in one go without splitting it up, like this:

$$\left(3x^2+2x\right) \times \left(2x^2 - 5\right) = 6x^4 + 4x^3 - 15x^2 - 10x$$

Multiplication table
Some people find it helpful to show this in a table, with one polynomial as rows and the other as columns: The headings are then multiplied to produce:

The answer is the sum of all the cells:

$$6x^4 + 4x^3 - 15x^2 - 10x$$, as before. This method is particularly useful for multiplying longer polynomials where the answer might not fit on a single line and cause mistakes.

Long multiplication
The polynomials to be multiplied can also be laid out like regular long multiplication, like this:

Division
Division of polynomials can be done just like regular long division. However, you will need to be quite adept at addition, subtraction and multiplication of polynomials to divide.

For example, to divide $$x^3 - 12x^2 - 42$$ by $$x-3$$ you write it like this:

 * $$x-3\overline{\vert x^3 - 12x^2 + 0x - 42}$$

1. Divide the first term of the dividend by the highest term of the divisor. Place the result above the bar (x3 ÷ x = x2).

\begin{matrix} x^2\\ \qquad\qquad\quad x-3\overline{\vert x^3 - 12x^2 + 0x - 42} \end{matrix} $$	 2. Multiply the divisor by the result you just obtained (the first term of the eventual quotient). Write the result under the first two terms of the dividend (x2 * (x-3) = x3 - 3x2).

\begin{matrix} x^2\\ \qquad\qquad\quad x-3\overline{\vert x^3 - 12x^2 + 0x - 42}\\ \qquad\;\; x^3 - 3x^2 \end{matrix} $$	 3. Subtract the product you just obtained from the appropriate terms of the original dividend, and write the result underneath. This can be tricky at times, because of the sign. ((x3-12x2) - (x3-3x2) = -12x2 + 3x2 = -9x2) Then, "pull down" the next term from the dividend.

\begin{matrix} x^2\\ \qquad\qquad\quad x-3\overline{\vert x^3 - 12x^2 + 0x - 42}\\ \qquad\;\; \underline{x^3 - \quad3x^2}\\ \qquad\qquad\qquad\quad\; -9x^2 + 0x \end{matrix} $$	 4. Repeat the last three steps, except this time use the two terms that you have just written as the dividend.

\begin{matrix} \; x^2 - 9x\\ \qquad\quad x-3\overline{\vert x^3 - 12x^2 + 0x - 42}\\ \;\; \underline{\;\;x^3 - \;\;3x^2}\\ \qquad\qquad\quad\; -9x^2 + 0x\\ \qquad\qquad\quad\; \underline{-9x^2 + 27x}\\ \qquad\qquad\qquad\qquad\qquad -27x - 42 \end{matrix} $$	 5. Repeat step 4. This time, there is nothing to "pull down".

\begin{matrix} \qquad\quad\;\, x^2 \; - 9x \quad - 27\\ \qquad\quad x-3\overline{\vert x^3 - 12x^2 + 0x - 42}\\ \;\; \underline{\;\;x^3 - \;\;3x^2}\\ \qquad\qquad\quad\; -9x^2 + 0x\\ \qquad\qquad\quad\; \underline{-9x^2 + 27x}\\ \qquad\qquad\qquad\qquad\qquad -27x - 42\\ \qquad\qquad\qquad\qquad\qquad \underline{-27x + 81}\\ \qquad\qquad\qquad\qquad\qquad\qquad\;\; -123 \end{matrix} $$	 The polynomial above the bar is your answer, and the number left over (-123) is the remainder.
 * $$\frac{x^3 - 12x^2 - 42}{x-3} = x^2 - 9x - 27$$ remainder $$-123$$

Curves of polynomials
It is possible to look at a polynomial and get an idea to the general shape of its curve. The most important factors are the degree of the polynomial, and the sign of the co-efficient of the highest power. For a more accurate sketch of the graph, you will need to know where the curve has turning points and where it intersects the $$x$$ and $$y$$ axis. A sketch with this information will often be sufficiently detailed, and is usually much quicker and easier than plotting the curve point by point.

Turning points
A turning point is where a curve that is decreasing changes to increasing, or vice versa. On a graph, the curve simply changes direction, hence the name turning point. In $$y=x^2$$, the turning point is at (0,0), the trough of the "bucket". The turning point in $$y=x^2$$ is a minimum (plural minima), and a maximum (plural maxima) is the same bucket shape, but upside down. For a polynomial of degree $$n$$, its curve will have at most $$n-1$$ turning points.

Behaviour with extreme values of $$x$$
What happens to a polynomial at large positive and negative values for $$x$$?

If we say $$1000$$ is our large number, we can put it into $$6x^4 + 4x^3 - 15x^2 - 10x$$, we can take a look at what happens:

First for $$x=1000$$: $$6000000000000 + 4000000000 - 15000000 - 10000 = 6003970000000$$

Now for $$x=-1000$$: $$6000000000000 - 4000000000 - 15000000 + 10000 = 5995985010000$$

The most change in the final answer is made by the $$x^4$$ term. This is the dominant term. For a polynomial of degree $$n$$, $$x^n$$ is the dominant term as $$x \rightarrow \pm\infty$$.

Once you have investigated the behaviour of polynomials with extreme values of $$x$$, you may notice that if $$n$$ is even, it will share the same general shape as $$x^2$$, and if $$n$$ is odd it will share the same general shape as $$x^3$$.

If the coefficient of $$x^n$$ is positive, curves with an even value of $$n$$ will have a bucket shape, and curves with an odd value of $$n$$ will generally be negative when $$x$$ is negative, and positive when $$x$$ is positive (like $$y = x$$).

If the coefficient of $$x^n$$ is negative, curves with an even value of $$n$$ will have an upside down bucket shape, and curves with an odd value of $$n$$ will generally be positive when $$x$$ is negative, and negative when $$x$$ is positive (similar to $$y = -x$$).

Intersections with axes
To find where the curve crosses the $$y$$ axis, you can simply look at the constant term. $$y = x^3 + 2x^2 - 9x - 18$$, for example, would cross the $$y$$ axis at $$-18$$. If there is no constant term, the curve will go through the origin, (0,0), and would therefore cross the $$y$$ axis at $$0$$.

In factorised form, you can find the points at which the curve crosses the $$x$$ axis. $$y = (x+3)(x+2)(x-3)$$ would cross the $$x$$ axis at $$-3$$, $$-2$$, and $$3$$, because by making one of the brackets equal to $$0$$, it makes the whole polynomial equal to $$0$$, and $$y$$ equal to $$0$$. $$y = 0$$ is of course the line of the $$x$$ axis. Each instance of the curve crossing the $$x$$ axis is a root of the equation. A polynomial of degree $$n$$ will have at most $$n$$ roots.

To solve an equation means to find every root. Polynomials of degree 2 can be solved using the quadratic formula. For higher degree polynomials you may need to factorise the equation like above, plot the graph point by point and look at where the curve crosses the $$x$$ axis, or use a numerical method. You can check your answers by substituting them into the original equation and seeing if the result is $$0$$.

Quadratic expressions
A quadratic is a polynomial of degree 2, in the form $$f(x)=ax^2+bx+c$$.

Graph
A quadratic graph is one that can be written in the form $$y=ax^2+bx+c$$. The graph of $$y=2x^2 + 8x + 2$$ is shown on the right, and as you can see it has the same characteristic "bucket" shape that all quadratics have, called a parabola. The vertex is the maximum or minimum point. The line of symmetry is the line that divides the graph into two mirror halves. It can be found by the formula $$\frac{-b}{2a}$$.

However, these properties can be more easily deduced from its completed square form ( $$a(x + d)^2 + e$$ ). In this form we know that, - d is the axis of symmetry, and that e is maximum or minimum point. If a is greater 0 then the vertex (-d,e) will be a minimum point. If a is less than 0 the vertex (-d,e) will be a maximum point.

Completing the square
Completing the square is the process of changing a quadratic from the form $$ax^2 + bx +c$$ to the equivalent form $$a(x+d)^2 + e$$, where a, d and e are constants. For example, the quadratic $$2x^2 + 8x +2$$ would become $$2(x+2)^2 - 6$$.

Changing a quadratic to completed square form makes it easy to find several things, such as the roots of the quadratic and the vertex of the quadratic, without even requiring a sketch.

Here are the steps for completing the square. Don't worry, it's easier than it looks.

So the completed square form of $$y=2x^2 + 8x + 2$$ is $$2(x+2)^2 -6$$. The $$-6$$ tells us that the lowest point of the curve is at $$y=-6$$ and the $$x+2$$ tells us that the line of symmetry is at $$x+2=0$$ or $$x = -2$$. Therefore the vertex is at $$(-2,-6)$$, and if you look at the graph, you can see that is the case.

The quadratic formula
The quadratic formula is derived from the general case of completing the square:

$$x =\frac{-b \pm \sqrt{b^2-4ac}}{2a}$$

It can be used to find the roots of a quadratic by putting numbers directly into it. For example, for $$y=2x^2 + 8x + 2$$:

$$x =\frac{-8 \pm \sqrt{64-16}}{4} = -2 \pm \sqrt{3}$$

so $$ x = -2 + \sqrt{3}$$ and $$x = -2 - \sqrt{3}$$. The factors of the equation are $$ x + 2 - \sqrt{3}$$ and $$x + 2 + \sqrt{3}$$.

Here is the way that the quadratic formula is derived from the completing the square formula.

The discriminant
Notice that the quadratic equation contains $$b^2 - 4ac$$ inside a square root sign. This part is called the discriminant and can be considered on its own to determine the number of roots of the equation.

 * If $$b^2 - 4ac<0$$ then you will be unable to find the square roots as you don't know how to square root a negative number. The type of numbers you have encountered so far are known as real numbers and so it is said that the quadratic has no real roots.
 * If $$b^2 - 4ac=0$$ then changing the $$\pm$$ sign in front of the square root won't make any difference, because it is zero either way. You will therefore get the same root twice, so it is said the quadratic has one repeated root.
 * If $$b^2 - 4ac>0$$ then the $$\pm$$ will mean you get two answers, and so you can say the quadratic has two distinct (i.e. different) roots.

title: A-level Mathematics/OCR/C1/Polynomials


text:
User:Karl Wick/Test

/Main Page/ | Main Page intro | Right text box | /Foundational Books/ | /Hot Picks/ | /Links/ | /Main Page Nav/ | /WikiJunior/ | Right image

title: User:Karl Wick/Test


text:
Business English/English Proverbs

A fool and his money are soon parted. - Franklin

The early bird gets the worm. - Franklin

Waste not, want not. - American proverb

Rome was not built in a day. - American proverb

Necessity is the mother of invention. - American proverb

If you want something done right, you have to do it yourself. - American saying

Early to bed, early to rise, makes a man healthy, wealthy and wise. - Benjamin Franklin, an American writing in Poor Richard's Almanac

Cheaters never prosper. - American proverb

It's not whether you win or lose, but how you play the game. - American proverb

Nice guys finish last. - American proverb

When in Rome, do as the Romans do. - American proverb

It's Greek to me. - Shakespeare

There's a sucker born every minute. - P.T. Barnum, American

title: Business English/English Proverbs


text:
Business English/Topics/American Business Culture

When in Rome, do as American tourists do everywhere – American proverb

Sometimes etiquette is easily explained to the non-native in a clear set of rules that any decent member of the culture follows. For example, in Japan it is considered impolite to show the soles of one’s shoes toward another person. However, sometimes the rules are not clear, and the polite person has to improvise to figure out the most polite thing to do. An example of this might be when the elder President Bush ducked below the table before vomiting at a state dinner. No book about culture or etiquette would have prepared him for that one, although now all American presidents place a strategically sited bowl beneath their chair at official events.

That said, the following is a simple explanation of the basic points of American Business Etiquette. This is a tool aimed at helping you do as Americans do when working with them on their own soil, over the telephone or even by email.

Work comes first
Americans and businessmen and women in particular are very task-oriented. They get a goal in mind and work until achieving it. In a scheduled meeting an American is likely to avoid chit-chat as idle chatter and will want to talk about business and little else. “Let’s focus on the task at hand” is an Americanism that reflects this tendency. Therefore be careful to not distract the conversation from the business at hand. Direct your comments towards identifying, and especially, solving problems. The people will feel more confidence in you when they feel that you are putting your heart behind the project at hand, whatever it may be. A big part of Americans’ lives revolve closely around their work, and although they may politely complain about it, the truth is that many of them like it like that. Americans do love to have fun, but it has its place, and that place should not interfere with work or a man or woman earning his or her livelihood.

Be very clear in what you say
Something that will madden your American partners is if they think that you beat around the bush in what you say. US culture values a person who says what he means and means what he says. "Get to the point!", frustrated teammates may demand.

Americans value clarity many times over what other cultures view as tact. It is better to lay everything out on the table, and not leave key points unmentioned for politeness’ sake. Not following this policy could be interpreted as rudeness or as gravely as dishonesty by your peers.

Honesty is the best policy
Related to the previous point, you will do well to avoid any kind of dishonesty in word or deed with your American partners. Do not suggest bribes, kickbacks, any other kind of illegal or unlawful payoffs, or anything else that goes against the law of the US or wherever it is that you are. Play by the rules. In the US, people get ahead while respecting the rules of the game. It has been said many times that, unlike other places, in the US it is easier to make money following the law than by breaking it, although this does not necessarily apply to US corporations operating abroad. Americans realize that if you are dishonest with the government or with anyone else, you are a dishonest person and will probably be dishonest with everyone or anyone that you work with, and are not to be trusted. That is, unless you are in a completely powerless situation where your every move can be controlled and all risk can be eliminated. But you don’t want to be in that situation, do you?

Logic rules over emotion
One of the worst things that you can do is appear overly emotional, or unable to make a cold, hard decision. It’s OK to get angry, and show it, about certain things, especially things that affect the bottom line. Don’t change your mind a lot of times if you don’t want to exasperate your coworkers.

That said, Americans don't like cold "robotic" coworkers either. It's fine to smile, laugh at a coworker's joke if it's genuinely funny, or to congratulate a coworker on a life event.

Respect the old guys
First off, don’t call them old guys. At least not to their faces. The senior partners at the firm have worked a long time to get there and although American entertainment may make fun of older citizens as worn-out or useless, the business world certainly does not treat them that way. They are to be respected as the wisest and most seasoned individuals on the team, which they likely are.

When dealing with them, speak to them and otherwise treat them with respect. Depending on the culture of the corporation, this may mean not to speak with them at all. Allow them to speak to you if they want something, otherwise it may be a good idea to not speak to them at all. A special note: if the executive is concerned about his advancing age and wants to be seen as younger than he really is, it may be better to speak to him more casually. In most cases, avoid using slang because it magnifies the difference between the generations and it may make the exec feel old or out of place, or worse yet, he may not even understand you.

Women are equal players
In US law, women are granted equal rights with men. Business women expect to be treated with the same respect as their male counterparts. They are considered to be equal to men in character and ability. Their gender is considered to be irrelevant in business settings.

It is absolutely inappropriate to make any sexual advances, make suggestive comments, or try to get them to go out for personal time not related to work. Do not treat them like secretaries unless, in fact, they are a secretary. Treat them with the same consideration as you would treat any co-worker.

Businessmen and sports
A lot of business persons were athletes in high school and college. There are many things that are similar between team sports and business activities, and both attract many of the same people. It is a good idea to become familiar with the basics of baseball, football, and basketball at least in order to make semi-intelligent sports-related small talk. Beyond small talk, business talk is filled with sports-related idioms, especially related to tactics which apply to both sports and business. These are used so commonly in American speech that the speaker probably will not even realize that he is using them.

The big two
There are two main subjects that Americans agree not to discuss much in polite conversation: That is because they are areas where people have deep-rooted beliefs that are not easily changed, and there is a great potential for misunderstanding or hurt feelings. Furthermore, outside of church or a political rally many people view them as unrelated to the whatever task you have on your plate at the time.
 * 1) Politics
 * 2) Religion

Criticizing the US
Besides this, avoid criticizing the US, US culture, Americans in general or US policy, unless they have recently invaded your country or have asked for your opinion (And even then consider how harsh your criticism is, and if it's warranted for the situation). Americans for the most part deeply love their country and may be offended and confused by comments that do not reflect a similar love and respect, and may take the comments personally. However, there is also a great diversity in their view of themselves; therefore do not expect them all to respond in the same way.

It's OK to be honest about the US and potential shortcomings when you are specifically asked, or if being blunt would help. For example, if a coworker is going on a business trip to your native region and they ask for advice, it's OK to mention the things Americans commonly do that won't go over well at the destination country.

Topics to talk about
There are certain topics that are common to talk about in casual business situations. Feel free to talk about the rich, sports, entertainment like movies, music, celebrities and books, and current events or business trends. Try to keep things general and not too personal. Nobody wants to know about your grandmother or problems with your spouse. When in doubt, talk business.


text:
English as an Additional Language/Homework

Lesson
Schoolchildren, also called school kids, do homework. They do not like it. At least, they say that they do not like it. Homework is assignments that children do outside of class. However, sometimes students have time in class to do their homework. When a teacher gives an assignment to do during class it is called class work. Both homework and class work are types of schoolwork.

Sometimes students answer questions in a textbook.

 * Teacher: Class, please turn your books to page seventy-one and do questions one through ten. If you don’t finish it is homework due tomorrow.
 * Teacher: Open your books to chapter three and do every other question on page forty-five. Turn them in on my desk at the end of class.

Other times, homework is doing research and writing a report about something.

 * Teacher: Your assignment will be a report about the causes of the US Civil War. It should be ten pages long, typed and double-spaced. Please include a bibliography of at least ten cited works. You may use the Internet. Please look up information in at least three books from the school library. Do not make more than three references to encyclopedias.

Students sometimes do homework together in groups. They call these groups study groups. This is part of the student’s sense of humor. This is because many American students prefer to socialize, or talk to their friends, than to do any work. Boys may tend to joke around while girls prefer to gossip about other girls.

Students in all levels of school may have to do homework. However, younger students usually have to do less homework than older students. In high school, some students may have to do several hours of homework a night. Students may do their homework at home or in a library. Another place where kids can work on their homework is in study hall. Study hall is an open period of the day. Students can use study hall to read, do homework, maybe talk with their friends, or make trouble.

Students sometimes complain that homework is boring. Other assignments are more interesting. Homework is hard if it makes you think a lot, and easy if it doesn’t make you think much. Americans call things that are easy “a piece of cake”. When a student finishes his or her homework he or she might like to relax for a while, go outside or watch some TV. Other homework assignments may be a reading, math problems, an art project, or filling in answers in a worksheet.

Vocabulary

 * schoolchildren – niños de la escuela - öğrenci - schüler
 * school kids – niños de la escuela - öğrenci - schüler
 * homework – tareas - ödev - hausaufgabe
 * assignments – tareas (cosas pedidas) - iş,görev - zuweisungen
 * class – clase - sınıf - klasse
 * students – estudiantes - öğrenci - schüler
 * class work – trabajo de clase - sınıf çalışması - klassaufgaben
 * schoolwork – trabajo de la escuela - okul çalışması - schulaufgaben
 * questions – preguntas, dudas - sorular - fragen
 * textbook – libro de texto -ders kitabı - lehrbuch
 * due – se debe entregar - yeterli - gerekli - aufgrund
 * to turn in – entregar - dönüş - liefernen
 * to do research – hacer investigación - araştırma yapmak - erforschen
 * to write a report – escribir un reporte - rapor yazmak - einen bericht schreiben
 * typed - escrito con máquina çeşit- örnek - typisierte
 * double-spaced – con espacio doble (entre líneas de texto) çift ara -
 * bibliography – bibliografía kaynak -bibliyografya
 * works – obras işler
 * information – información bilgi
 * books – libros kitaplar
 * library – biblioteca kütüphane
 * references – referencias danışmalar başvurmalar
 * encyclopedias – enciclopedias ansiklopedi
 * study groups – grupos de estudio çalışma grubu
 * socialize – socializar toplum içine girmek -girişgen
 * joke around – hacer bromas şakalaşmak
 * gossip – chismear dedikodu
 * younger – más jóven çok genç
 * older – más grande çok yaşlı
 * at home – en casa evde
 * study hall – periodio (sala) de estudio çalışma salonu
 * open period – periodo abierto bir ders
 * read – leer okumak
 * make trouble – hacer problemas sorun yaratmak(başbelası)
 * complain – quejarse şikayet etmek yakınmak
 * boring – aburrido sıkıcı
 * interesting – interesante ilginç ilgi çekici
 * hard – difícil (duro) zor
 * easy – fácil kolay
 * think – pensar düşünmek
 * a piece of cake – algo fácil, “un pedazo de pastel” bir parça kek
 * to finish – terminar bitmek,bitirmek,son
 * reading – lectura okuma
 * math problems – problemas de matemática matematik problemi
 * art project – projecto de arte sanat projesi
 * filling in answers – llenando respuestas cevapları doldurma
 * worksheet – hoja de trabajo çalıma kağıdı,test


text:
Business English/Getting More Practice

If you live in the United States, the UK, Canada, Australia or another English-speaking country it is easy for you to practice all of the time watching TV, going to the store, making new friends. If you do not live in an English-speaking area, it may be harder to get practice.

Several magazines are published internationally and will help you practice your reading and listening skills.

 * English2Go, published by Reader's Digest
 * Speak Up, published in Brazil and in Italy.
 * Hot English, this one is OK too

You can also try listening to podcasts - free MP3 lessons you can download to you computer or MP3 player:

Business English Pod - Business English lessons by podcast for intermediate and advanced learners featuring useful phrases and vocabulary. Listening quizzes, transcripts and online exercises available for extra practice.

title: Business English/Getting More Practice


text:
Cookbook:Feature requests

This page is to help plan future feature request that would be useful to the Cookbook. For each new feature, please create a subpage of this page, by simply creating a link in the list below that looks like Name of requested feature, then click the link to begin editing the request. When the requesters think they've figured out what they really want their request to do, they should then file a feature request at bugzilla.wikipedia.org, and link back to the subpage about their feature.

 * /Recipe attributes/
 * /Ingredient affinity/
 * /Rating and feedback system/
 * /Pictorials describing steps/
 * /Menus - should add a list of menus which combine recipes/
 * /Complete book downloadable as PDF/
 * /Complete book downloadable as EPUB/
 * /A basic cooking tutorial, starting from scratch/
 * Structure recipes should be better structured

title: Cookbook:Feature requests


text:
Cookbook:Feature requests/Rating and feedback system

As SamSam said about his categorization and filtering suggestion, I have concerns about the cookbook's scalability. From my experience using public recipe sites, I have found that the more recipes they accumulate, the less useful they become. Even with a robust categorization system, the duplicate recipes make it very hard to research what you want to make. Although it may be some work, I suggest that we implement a rating and feedback system as I find this greatly increases a site's usefulness. This idea was inspired by VegWeb (http://vegweb.com), which is a public recipe site that is a pleasure to peruse as compared with other sites such as cooks.com that (http://www.cooks.com) seem sterile due to the lack of public feedback. An open feedback forum on the recipe page is vital for the testing of the recipes and for the opening of dialogue that is so much a part of the creative process of cooking. Variations of recipes can be posted here and a rating system can be implemented for the feedback entries to prioritize entries that people found most useful/informative and to highlight variations on recipes that are most popular. This system should be on the front end and easily accessible to the public, thus not in any way restricted to active builders of the book's content. This would be an excellent way of dealing with the philosophical issue raised by Snowspinner (above) about open-ended vs fixed recipes. I am an advocate for the open-ended approach, but a recipe can get too overwhelming with too much information at once. The original author of a recipe should still be allowed to put in as much extra information as they would like such as variations, cooking techniques, ingredient information, etc. However, a feedback system would be an indispensable way of building this extra information that everyone can learn from.

--Gothicsurf 19:01, 18 Jan 2005 (UTC)


text:
Cookbook:Feature requests/Recipe attributes

I've been navigating around Cookbook and I find it is not scalable. Recipe lists will get (I expect) too long to display on a single page and navigating just by one category or alphabetically just wont do it. Mantaining these lists is just not a requisite and recipes could just be hanging there.

As a Sourceforge and Freshmeat user, I found their way of browsing much more easy. A project has specific attributes and you can browse/filter by them. You don't have to add it to the different indexes, it is just there.

A recipe could have specific attributes like ingredients, time to cook, region, type of food, calories, etc. With an automatic indexing system, it would be automatically linked on every category under the attribute specified. This would avoid mantainance time of index pages and maximize search capabilities.

Searching would by as easy as browsing by region (for example, Asian --> Chinese --> Cantonese) and filtering by ingredient (for example, all that have the ingredient Rice and doesn't have Tuna) and by time to cook (for example, less than 30 minutes).

I don't know if wikimedia can do it, but it would be really cool.

--SamSam 20:25, 3 Nov 2004 (UTC)

 * Its being worked on in the form of Metadata for not just the cookbook but for Mediawiki sites in general. It was discussed at Wikimania 2005 but I'm not sure how far it has come.  For now, try to follow a standard way of identifing these attributes, as it will make the eventual conversion easier.  Luke Bales 86.133.219.129 15:02, 1 November 2005 (UTC)


text:
Talk:Cryptography/DES

Hugo Machado Falcão

title: Talk:Cryptography/DES


text:
User talk:TheTRUTH~enwikibooks

Beating Season must be undeleted.

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called TheTRUTH. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name TheTRUTH~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:47, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:35, 19 April 2015 (UTC)

title: User talk:TheTRUTH~enwikibooks


text:
IB/Group 4/Computer Science

Computer Science is an experimental science that offers a rigorous and practical problem-solving discipline, which, as a methodology, can be applied to all walks of life. "If we suppose that many natural phenomena are in effect computations, the study of computer science can tell us about the kinds of natural phenomena that can occur."

- Rudy Rucker

"Computer science is no more about computers than astronomy is about telescopes."

- Edsger Dijkstra

"Computer Science is embarrassed by the computer."

- Alan Perlis

Standard Level
Topic 1 - System Fundamentals

Topic 2 - Computer Organisation

Topic 3 - Networks

Topic 4 - Computational Thinking, Problem-Solving, and Programming

Higher Level
Topic 5 - Abstract Data Structures

Topic 6 - Resource Management

Topic 7 - Control

Options
Option A - Databases

Option B - Modelling and Simulation

Option C - Web Science

Option D - Object-Oriented Programming {{IB/Extension|

Outside the syllabus
Limitations of computing

Artificial Intelligence }}

Extras
Extended Essay

Definitions

About this Book
This wiki is in no way endorsed or a stem from the International Baccalaureate Organisation. It is, however, the result of particular lack of a solid textbook for the new 2014 course. These pages are, furthermore, derived from notes and knowledge of a student taking the course. This wiki will, hopefully, act as a course companion. You may find the Definitions page useful for revision.

Syllabus
The syllabus is an ideal document that should be referred to on a regular basis, whilst reading this wiki or not. It provides extensive details regarding what should be learnt rather than the content itself, as this wiki hopes to provide the end to that need. Therefore, each objective has been specified above the content that it is associated with. For example:

The example aforementioned is self explanatory, however, the X.Y.Z refers to the topic, sub-topic and objective, respectively.

title: IB/Group 4/Computer Science


text: User:Skip Berkes

title: User:Skip Berkes


text:
User talk:Jm51~enwikibooks

From Trolling, The most important thing about trolls is not to feed them. Gentgeen 01:32, 19 Jan 2005 (UTC)

 * To further explain what I mean, once I determined you and your fans were acting as trolls, I chose not to reply the obvious provocations, so you wouldn't get the satisfaction of evoking a reaction. Gentgeen 01:35, 19 Jan 2005 (UTC)

You have been blocked because of your behaviour as 69.42.5.198, as reported by a developer User:Tim Starling, on IRC:  69.42.5.198 matches jm51 You have used this IP as a VfD sockpuppet, to recreate deleted articles, thus evading due process, and several acts of vandalism. Dysprosia 09:57, 19 Jan 2005 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called Jm51. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name Jm51~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 23:20, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 05:05, 19 April 2015 (UTC)

title: User talk:Jm51~enwikibooks


text:
Logic for Computer Science

This book discusses logic as a tool for computer science; a field that uses logic at all levels. It provides a survey of mathematical logic and its various applications. Some areas where it is particularly important include:
 * Digital circuit design
 * Complexity theory (NP equivalent to Existential second-order logic)
 * Database Systems (SQL; roughly predicate/first-order logic)
 * Computer-aided verification (Temporal logic & model checking)
 * Programming languages (lambda calculus)
 * AI, expert systems, inference engines
 * Distributed Systems
 * Logic Programming
 * Computer Security

After covering basic material of propositional logic and first-order logic, the course presents the foundations of finite model theory and descriptive complexity. Other topics, including logic programming, non-monotonic reasoning, temporal logic, and reasoning about knowledge and belief, are surveyed as time allows. These notes were taken by student scribes.

title: Logic for Computer Science


text:
Logic for Computer Science/Propositional Logic

Propositional Logic
Propositional logic is a good vehicle to introduce basic properties of logic. It does not provide means to determine the validity (truth or false) of atomic statements. Instead, it allows you to evaluate the validity of compound statements given the validity of its atomic components.

For example, consider the following:
 * I like Pat or I like Joe.
 * If I like Pat then I like Joe.
 * Do I like Joe?

Accept as facts the first two statements, noting that the use of "or" here is not exclusive and thus could really be thought of as saying "I like Pat, or I like Joe, or I like them both". Do these statements imply that "I like Joe" is true? Try to convince yourself that "I like Joe" is true, and consider another line of reasoning:
 * Pigs can fly or fish can sing.
 * If pigs can fly then fish can sing.
 * Can fish sing?

We can see that the answer is yes in both cases. The above two sets of statements can be both abstracted as follows:
 * $$\begin{align}&P\lor Q\\&P\to Q\\&Q\end{align}$$?

Here, we are concerned about the logical reasoning itself, and not the statements. Thus, instead of working with pigs or Pats, we simply write $$Q$$s or $$P$$s. We begin our study first with the syntax of propositional logic: that is, we describe the elements in our language of logic and how they are written. We then describe the semantics of these symbols: that is, what the symbols mean.

Syntax
The syntax of propositional logic is composed of propositional symbols, logical connectives, and parenthesis. Rules govern how these elements can be written together. First, we treat propositional symbols merely as a set of some symbols, for our purposes we'll use letters of the Roman and Greek alphabets, and refer to the set of all symbols as $$\text{Prop}$$:
 * Propositional symbols: A set $$\text{Prop}$$ of some symbols. For example $$p,q,r,\ldots$$

Second, we have the logical connectives:
 * Logical connectives: $$\land,\lor,\neg,\to$$

Note that these are not the minimal required set; they can be equivalently represented only using the single connective NOR (not-or) or NAND (not-and) as is used at the lowest level in computer hardware. Finally, we use parenthesis to denote expressions (later on we make parenthesis optional):
 * Parentheses: $$$$

An expression is a string of propositional symbols, parenthesis, and logical connectives.

The expressions we consider are called formulas. The set $$\textrm{Form}$$ of formulas is the smallest set of expressions such that:
 * 1) $$\text{Prop}\sube\text{Form}$$
 * 2) If $$\phi,\psi\in\text{Form}$$ then
 * 3) $$(\phi\land\psi)\in\text{Form}$$ ,
 * 4) $$(\phi\lor\psi)\in\text{Form}$$ ,
 * 5) $$(\phi\to\psi)\in\text{Form}$$, and
 * 6) $$(\neg\phi)\in\text{Form}$$.

Another way to define formulas is as the language defined by the following context-free grammar (with start symbol $$\text{Form}$$):
 * $$\text{Form}\Rarr\text{Prop}$$, where $$\text{Prop}$$ stands for any propositional symbol
 * $$\begin{align}\text{Form}\Rarr(\text{Form}\land\text{Form})\\\text{Form}\Rarr(\text{Form}\lor\text{Form})\\\text{Form}\Rarr(\text{Form}\to \text{Form})\\\text{Form}\Rarr(\neg\text{Form})\end{align}$$

Fact 1 (Unique Readability): The above context free grammar is unambiguous.

Semantics
The function of a formula is to create meanings of statements given meanings of atomic statements. The semantics of a formula $$\phi$$ with propositional symbols $$p_1,\ldots,p_n$$ is a mapping associating to each truth assignment $$V$$ to $$p_1,\ldots,p_n$$ a truth value (0 or 1) for $$\phi$$. (The truth values true and false can be used instead of 1 or 0, respectively, as well as the abbreviations T and F.)

The semantics are well defined due to Fact 1 (seen just above).

One way to specify semantics of a logical connective is via a truth table:
 * {| border=1 style=text-align:center

! $$p$$ !! $$q$$ !! $$p\land q$$ (p and q)
 * 0 || 0 || 0
 * 0 || 1 || 0
 * 1 || 0 || 0
 * 1 || 1 || 1
 * }
 * 1 || 0 || 0
 * 1 || 1 || 1
 * }
 * }

Can one always find a formula that implements any given semantics? Yes, any truth table is realized by a formula. The formula can be found as follows. "Represent" the rows where $$\phi=1$$ with conjunctions of the true proposition symbols and negations of the false ones. Finally write the disjunction of the results.

For example,
 * {| border=1 style=text-align:center

! $$p$$ !! $$q$$ !! $$\phi$$ !! Conjunctions (true values only)
 * 0 || 0 || 1 || $$\neg p\land\neg q$$
 * 0 || 1 || 0 ||
 * 1 || 0 || 1 || $$p\land\neg q$$
 * 1 || 1 || 0 ||
 * }
 * 1 || 0 || 1 || $$p\land\neg q$$
 * 1 || 1 || 0 ||
 * }
 * }

$$\phi:(p\land\neg q)\lor(\neg p\land\neg q)$$

Corollary: Every formula is equivalent to a disjunction of conjunctions of propositional symbols or negation of propositional symbols (DNF).

Dual of DNF is CNF.

To get $$\phi$$ in CNF:
 * 1) Describe cases when $$\phi$$ is false.
 * 2) Note that $$\phi$$ is true when $$\neg \psi$$ is false. Hence, negate $$\psi$$ using DeMorgan's laws.

There are cases when DNF (resp. CNF) is exponentially larger than the original formula. For example, for $$(x_1\lor y_1)\land\cdots\land(x_n\lor y_n)$$ the equivalent DNF is exponential in size.

Does each truth table have a polynomial size formula implementing it? More precisely, does there exist $$k$$ such that every truth table with $$n$$ propositional symbols has a form $$\phi$$ of size $$\le n^k$$ ? Answer: no.

Proof: Assume there exists such $$k$$. The number of truth tables for $$n$$ propositional symbols is $$2^{2^n}$$. The number of formulas of size $$\le n^k$$ is $$(n+6)^{n^k}$$ ($$n$$ propositional symbols, 4 connectives and parentheses.) Clearly, $$(n+6)^{n^k}<2^{2^n}$$, for sufficiently large $$n$$.

[TODO: exposition to explain what these definitions are and provide their context]

 * Satisfaction: Satisfaction of a formula $$\phi$$ by a truth assignment $$\tau$$ . Notation: $$\tau\models\phi$$ ($$\phi$$ is true for $$\tau$$).
 * Implication: A set of formulas $$\Sigma$$ implies $$\phi$$ . Notation: $$\Sigma\models\phi$$ . $$\Sigma$$ implies $$\phi$$ if and only if every truth assignment that satisfies $$\Sigma$$ also satisfies $$\phi$$.

Formula Classes of Special Interest

 * $$\text{VALID}$$ – the set of formulas that are always true (also known as tautologies). For example, $$(p\lor\neg p),(p\to p),([(p\lor q)\land(p\to q)]\to q)$$ are valid formulas.
 * $$\text{UNSAT}$$ – the set of formulas that are never true (unsatisfiable).
 * In between: $$\text{SAT}$$ - the set of formulas for which there exists a satisfying assignment (not unsatisfiable).

Note. $$\phi\in\text{VALID}\iff\neg\phi\in\text{UNSAT}$$.

Claim: $$\Sigma\models\phi\iff(\Sigma\cup\{\neg\phi\})\in\text{UNSAT}$$

Claim: $$\text{SAT}$$ is NP-complete.

Proof:
 * $$\text{SAT}\in\text{NP}$$ : guess a satisfying assignment, then verify that the formula is true (a satisfying assignment is a certificate).
 * Hardness. graph 3-coloring $$\in\text{NP}$$ (there also exists a direct proof). We reduce 3-coloring to $$\text{SAT}$$. Let $$G=(V,E)$$ be a graph with $$n$$ nodes $$\{1,\ldots,n\}$$ . We use propositional variables $$p_{i,g},p_{i,r},p_{i,b}$$ to indicate that vertex $$i$$ is colored with green, red, or blue. Construct $$\phi$$ as follows:
 * $$\begin{align}\phi=&\bigwedge_{i=1}^n\bigl((p_{i,g}\land\neg p_{i,r}\land\neg p_{i,b})\lor(p_{i,r}\land\neg p_{i,g}\land\neg p_{i,b})\lor(p_{i,b}\land\neg p_{i,r}\land\neg p_{i,g})\bigr)\\&\wedge\bigwedge_{(i,j\in E)}\neg(p_{i,g}\land p_{j,g})\land\neg (p_{i,r}\land p_{j,r})\land\neg(p_{i,b}\land p_{j,b})\end{align}$$

Claim: $$G\in\text{3-Coloring}\iff\phi\in\text{SAT}$$.

It is also possible to prove that $$\textrm{SAT}\in\text{NP}$$ directly

Claim: $$\text{VALID}\in\text{coNP}$$.

Horn Clauses
Special case for which SAT is in polynomial time. Example:
 * $$(p\lor\neg q\lor r)\land(\neg p\lor q\lor\neg r)$$

A Horn clause is a disjunction of literals of which at most one is positive. There are two kinds of possible Horn clauses:
 * 1) clause has 1 positive literal
 * 2) $$p$$, or
 * 3) $$p\lor\neg x_1\lor\cdots\lor\neg x_k:x_1\land\cdots\land x_k\to p$$
 * 4) no positive literal
 * 5) $$\neg x_1\lor\cdots\lor\neg x_k:\neg(x_1\land\cdots\land x_k)$$
 * 6) $$x_1\land\cdots\land x_k\to\text{false}$$

Claim: For every set $$\Sigma$$ of Horn formulas, checking whether $$\Sigma$$ is satisfiable is in $$\text{P}$$.

Proof Idea: Let $$\Sigma_1$$ be the subset of $$\Sigma$$ containing only clauses of type 1, and $$\Sigma_2$$ the subset of $$\Sigma$$ containing clauses of type 2. Note first that $$\Sigma_1$$ is satisfiable. To obtain a minimum satisfying assignment $$\sigma$$, start with literals from single-literal clauses and crank the rules. It now remains to check consistency of $$\sigma$$ with the clauses in $$\Sigma_2$$. To do this, it is enough to check that for each clause $$x_1\land\cdots\land x_k\to\text{false}$$ in $$\Sigma_2$$, $$\sigma$$ is not true for all of $$x_1,\ldots,x_k$$.

Example: Consider the set $$\Sigma$$ of Horn clauses:
 * $$\begin{align}&p\\&q\\&r\\&\neg p\lor\neg q\lor s\\&\neg s\lor\neg r\lor t\\&\neg t\end{align}$$

The set $$\Sigma_1$$ of clauses of type 1 consists of the first 5 clauses, and $$\Sigma_2$$ consists of the last clause. Note that $$\Sigma_1$$ can also be written as:
 * $$\begin{align}&p\\&q\\&r\\&p\land q\to s\\&s\land r\to t\end{align}$$

The minimum satisfying assignment for $$\Sigma_1$$ is obtained as follows: Thus, the minimum satisfying assignment makes $$\{p,q,r,s,t\}$$ true. This contradicts $$\Sigma_2$$, which states that $$t$$ must be false. Thus, $$\Sigma$$ is not satisfiable.
 * 1) start with $$\{p,q,r\}$$
 * 2) use the first implication to infer $$s$$
 * 3) use the second implication to infer $$t$$

Deductive Systems
A deductive system is a mechanism for proving new statements from given statements.

Let $$\Sigma$$ be a set of known valid statements (propositional formulas). In a deductive system, there are two components: inference rules and proofs.

 * Inference rules
 * An inference rule indicates that if certain set of statements (formulas) $$\varphi_1,\ldots,\varphi_k$$ is true, then a given statement $$\varphi$$ must be true. An inference rule $$H$$ is denoted as $$H:\frac{\varphi_1,\ldots,\varphi_k}{\varphi}$$.
 * Example (modus ponens): $$\frac{p,p\to q}{q}$$

A proof of $$\varphi$$ from $$\Sigma$$ is sequence of formulas $$\varphi_1,\ldots,\varphi_n$$ such that $$\varphi_n=\varphi$$ and for all $$i\le n$$
 * Proofs
 * Each formula $$\varphi_i\in\Sigma$$, or
 * There are a subset of formulas $$\varphi_{i_1},\ldots,\varphi_{i_k}:i_1,\ldots,i_k<i$$, such that $$\frac{\varphi_{i_1},\ldots,\varphi_{i_k}}{\varphi_i}$$ is an inference rule.

If $$\varphi$$ has a proof from $$\Sigma$$ using inference rule $$H$$ we write $$\Sigma\vdash_H\varphi$$.

Properties:
 * Soundness: If $$\Sigma\vdash_H\varphi$$ then $$\Sigma\models\varphi$$ (i.e., all provable sentences are true). This property is fundamental for the correctness of the deductive system.
 * Completeness: If $$\Sigma\models\varphi$$ then $$\Sigma\vdash_H\varphi$$ (i.e., all true sentences are provable). This is a desirable property in deductive systems.

Natural Deduction
Natural deduction is a collection of inference rules. Let $$\perp$$ denote contradiction, falsity. The following are the inference rules of natural deduction:
 * 1) $$\left\{\frac{\varphi,\psi}{\varphi\land\psi}\right.$$
 * 2) $$\left\{\frac{\varphi\land\psi}{\varphi}\right.$$
 * 3) $$\left\{\frac{\varphi\land\psi}{\psi}\right.$$
 * 4) $$\left\{\frac{\varphi,\varphi\to\psi}{\psi}\right.$$
 * 5) $$\left\{\frac{\varphi,\neg\varphi}{\perp}\right.$$
 * 6) $$\left\{\frac{\neg(\neg\varphi)}{\varphi}\right.$$
 * 7) $$\left\{\frac{\perp}{\varphi}\right.$$
 * 8) $$\left\{\frac{\varphi\to\psi,\psi\to\varphi}{\varphi\lrarr\psi}\right.$$
 * 9) $$\left\{\frac{\varphi\lrarr\psi}{\varphi\to\psi}\right.$$
 * 10) $$\left\{\frac{\varphi\lrarr\psi}{\psi\to\varphi}\right.$$
 * 11) $$\left\{\frac{\varphi}{\varphi\lor\psi}\right.$$
 * 12) $$\left\{\frac{\psi}{\varphi\lor\psi}\right.$$
 * 13) $$\begin{cases}\dfrac{\begin{matrix}\varphi\\\vdots\\\psi\end{matrix}}{\varphi\to\psi}\end{cases}$$
 * 14) $$\begin{cases}\dfrac{\begin{matrix}\varphi\\\vdots\\\perp\end{matrix}}{\neg\varphi}\end{cases}$$
 * 15) $$\begin{cases}\dfrac{\begin{matrix}\neg\varphi\\\vdots\\\perp\end{matrix}}{\varphi}\end{cases}$$
 * 16) $$\begin{cases}\dfrac{\begin{matrix}\varphi\lor\psi&\varphi&\psi\\&\vdots&\vdots\\&\rho&\rho\end{matrix}}{\rho}\end{cases}$$

Rule (13) allows us to prove valid statements of the form "If $$\varphi$$ then $$\psi$$" even if we don't know the truth value of the $$\varphi$$ statement (i.e., $$\varphi$$ is not in the set $$\Sigma$$ of known valid statements). Indeed, for this rule, we start assuming $$\varphi$$ is valid. If we can conclude $$\psi$$ is valid in a world where $$\Sigma\cup\varphi$$ are valid, then we conclude that the relation $$\varphi\to\psi$$ is true, and we "release" the assumption $$\varphi$$ is valid.

We now show how to apply the above inference rules.

Example: De Morgan's Law for negated or-expressions says:
 * $$\neg(\varphi\lor\psi)\lrarr(\neg\varphi\land\neg\psi)$$

Proof: By rule $$(8)$$ if we can prove $$\neg(\varphi\lor\psi)\to(\neg\varphi\land\neg\psi)$$ and $$(\neg\varphi\land\neg\psi)\to\neg(\varphi\lor\psi)$$ we can infer the desired result.

To prove the first direction, we use rule 13 and assume the hypothesis $$\neg (\varphi \vee \psi)$$. Then
 * $$\neg(\varphi\lor\psi)$$ (assumed)
 * $$\varphi$$ (assumed)
 * $$\varphi\lor\psi$$ (by rule 11)
 * $$\perp$$ (by rule 5)
 * $$\neg\varphi$$ (by rule 14)
 * $$\psi$$ (assumed)
 * $$\varphi\lor\psi$$ (by rule 11)
 * $$\perp$$ (by rule 5)
 * $$\neg\psi$$ (by rule 14)
 * $$\neg\varphi\land\neg\psi$$ (by rule 1)
 * $$\neg(\varphi\lor\psi)\to(\neg\varphi\land\neg\psi)$$ (by rule 13)

We now prove the second direction.
 * $$\neg\varphi\land\neg\psi$$ (assumed)
 * $$\neg\varphi$$ (by rule 2)
 * $$\neg\psi$$ (by rule 3)
 * $$\varphi\lor\psi$$ (assumed)
 * $$\varphi\psi$$ (assumed)
 * $$\perp\perp$$ (by rule 5)
 * $$\perp$$(by rule 16)
 * $$\neg(\varphi\lor\psi)$$ (by rule 14)
 * $$(\neg\varphi\land\neg\psi)\to\neg(\varphi\lor\psi)$$ (by rule 13)

Proof of Pierce's Law:
 * $$[(A\to B)\to A]\to A$$
 * $$(A\to B)\to A$$ (assumed) (1*)
 * $$\neg A$$ (assumed)
 * $$A$$ (assumed)
 * $$\perp$$ (by rule 5)
 * $$B$$ (by rule 7)
 * $$A\to B$$ (by rule 13)
 * $$A$$ (by assumption (1*) and rule 4)
 * $$\perp$$ (by rule 5)
 * $$A$$ (by rule 14)
 * $$[(A\to B)\to A]\to A$$ (by rule 13)

Fact 2: Natural deduction is sound.

To show that natural deduction is also complete we need to introduce propositional resolution.

Propositional Resolution
Resolution is another procedure for checking validity of statements. It involves clauses, formulas and a single resolution rule.

Some terminology:
 * Clause
 * A clause is a propositional formula composed by disjunction of literals. For example $$p\lor q\lor\neg r$$ . It is usually denoted as the set of literals, e.g. $$\{p,q,\neg r\}$$.
 * The empty clause, denoted as an open box "$$\Box$$", is the disjunction of no literals. It is always false.

 * Formula
 * A set of clauses, each of them satisfiable. For example, $$\bigl\{\{p,\neg q\},\{r\},\{\neg r, s\}\bigr\}$$ represents the CNF formula $$(p\lor\neg q)\land(r)\land(\neg r\lor s)$$.
 * The empty formula, denoted as $$\varnothing$$, is the set that contains no clauses. It is always true.

 * Resolution Rule
 * It is a rule that, given two clauses $$C$$ (containing some literal $$y$$) and $$C'$$ (containing some literal $$\neg y$$), allows to infer a new clause, called the resolvent of $$C$$ and $$C'$$ (with respect to $$y$$).

A proof system for resolution contains a single resolution rule, where the resolvent is defined as follows. Assume $$C$$ and $$C'$$ are clauses such that $$y\in C$$ and $$\neg y\in C'$$, then
 * $$\text{Res}_y(C,C')=(C-\{y\})\cup(C'-\{\neg y\})$$

The smallest set of clauses containing $$\varphi$$ and closed under resolution is denoted $$\text{Res}(\varphi)$$.

Example: If $$C=\{p,y\}$$ and $$C'=\{q,\neg y\}$$, then $$\text{Res}_y(C,C')=\{p,q\}$$.

It is possible to show that the resolution rule, as defined, computes a clause that can be inferred using natural deduction.

Claim: Let $$C$$ and $$C'$$ be any two clauses such that $$y\in C$$ and $$\neg y\in C'$$. Then $$C\land C'\implies\text{Res}_y(C,C')$$.

In order to prove the validity of a statement $$\psi$$, we will prove the negated statement $$\neg\psi$$ is unsatisfiable. To prove unsatisfiability of a formula $$\varphi$$, we need to define the resolution refutation of the formula $$\varphi$$ :

The resolution refutation tree of the formula $$\varphi$$ is a tree rooted at the empty clause, where every leaf is a clause in $$\varphi$$ and each internal node is computed as the resolvent of the two corresponding children.

Notice that clauses of $$\varphi$$ can appear repeated as leaves. From above claim we can conclude that:

Claim: If there exists a resolution refutation tree for formula $$\varphi$$, then $$\varphi\implies\Box$$ , that is, $$\varphi$$ is unsatisfiable.

Example: The formula
 * $$\varphi=(p\lor q)\land(\neg q\lor r)\land(\neg r)\land(\neg p\lor\neg s)\land(s\lor\neg t)\land(t)$$

has the following resolution refutation tree:

The order in which clauses are selected to compute the resolvent matters when computing the resolution refutation tree, as the following example shows: Consider the formula
 * $$\psi=(p\lor q)\land(\neg q\lor r)\land(\neg p)\land(\neg q)$$

Even though a resolution refutation tree may exist for $$\psi$$, order is important when trying to build the tree. Below are two different resolution refutation trees, but only one is successful:

Properties of Propositional Resolution
Soundness: Propositional resolution is sound, that is, if there exists a resolution refutation tree for a given formula $$\varphi$$, then $$\varphi$$ must be unsatisfiable.

Theorem: For any formula $$\varphi$$, if $$\Box \in Res(\varphi)$$, then $$\varphi \implies \Box$$.

Completeness: Propositional resolution is complete, that is, if a given formula $$\varphi$$ is unsatisfiable, then $$\varphi$$ has a resolution refutation tree.

Theorem: For any formula $$\varphi$$, if $$\varphi \implies \Box$$, then $$\Box \in Res(\varphi)$$.

Proof: By induction on the number of variables in $$\varphi$$.

Basis: We have one variable, say $$p$$. All possible clauses of $$\varphi$$ are $$\{p\}$$ and $$\{\lnot p\}$$. If $$\varphi$$ is unsatisfiable then both clauses occur, and therefore $$\Box \in Res(\varphi)$$.

Induction step: Suppose the hypothesis is true for formulas with less than $$n$$ variables. Let $$\varphi$$ be a formula with $$n$$ variables. Suppose $$\Box \notin Res(\varphi)$$; we will show $$\varphi$$ is satisfiable. Let $$p$$ be a variable of $$\varphi$$. Then either $$\{p\}\notin Res(\varphi)$$ or $$\{\lnot p\}\notin Res(\varphi)$$ (if both hold then $$\Box\in Res(\varphi)$$ immediately).

Assume $$\{\lnot p\}\notin Res(\varphi)$$. We define the formula $$\varphi^p$$ as containing all clauses that do not contain $$\{p\}$$ and where the literal $$\lnot p$$ has been removed from each clause (in other words, $$\varphi^p$$ is equivalent to the formula resulting from setting $$p$$ true).

Formally,
 * $$\varphi^p = \{C-\{\lnot p\} : C\in \varphi,\,p\notin C\}$$.

First, notice that
 * $$Res(\varphi^p) = \{C-\{\lnot p\} : C\in Res(\varphi),\,p\notin C\}$$

and thus,
 * $$\{\lnot p\}\notin Res(\varphi^p)$$.

Also, since $$\Box\notin Res(\varphi)$$ we have that $$\Box\notin Res(\varphi^p)$$. By the induction hypothesis, $$\varphi^p$$ is satisfiable. Then $$\varphi$$ is satisfiable by an extension of the satisfying assignment of $$\varphi^p$$ with $$p$$ equal true. The case $$\{p\}\in Res(\varphi)$$ is analogous.

Completeness of Natural Deduction
Theorem: Let $$H$$ be the set of inference rules of Natural Deduction. If $$\Sigma \models \varphi$$ then $$\Sigma \vdash_H \varphi$$.

The idea behind the proof of completeness of natural deduction is as follows. Suppose $$\varphi$$ is valid (then $$\lnot \varphi$$ is unsatisfiable). We then show there exists a resolution refutation for $$\varphi$$ and then by applying the contradiction rule (rule 15):
 * $$\frac{\begin{matrix}\neg \varphi\\\vdots\\\perp\end{matrix}}{\varphi}$$

we conclude $$\varphi$$ can be inferred.

Proof: (Sketch) Given a formula $$\varphi$$ valid under $$\Sigma$$, we perform the following steps: Step (1) can be easily done by repeated application of De Morgan's laws. Step (2) can be proven using natural deduction. Finally, step (3) can be proven by induction on the number of steps to obtain $$Res(\psi)$$. Clearly, each step can be simulated using natural deduction. It is very likely that any algorithm for propositional resolution will take very long on the worst case (recall that checking validity of a formula $$\varphi$$ is co-NP complete).
 * 1) Prove that $$\lnot \varphi$$ is equivalent to some $$\psi$$, where $$\psi$$ is in CNF.
 * 2) Prove that $$\psi \implies Res(\psi)$$, for all $$\psi$$.
 * 3) By completeness of resolution, if $$\psi$$ is unsatisfiable then $$\Box \in Res(\psi)$$. Therefore, $$\{p\}$$ and $$\{\lnot p\} \in Res(\psi)$$ for some literal $$p$$. This implies $$Res(\psi)\implies \bot$$.
 * 4) Conclude that $$\lnot \varphi \implies \bot$$ and therefore $$\varphi$$ is valid.

Linear Resolution and PROLOG
Linear resolution is a particular resolution strategy that always resolves the most recent resolvent with a clause. The resolution refutation tree so obtained is therefore linear. It is possible to prove that, if the set of clauses are Horn clauses, there exists a linear resolution strategy for any formula. That is, linear resolution is complete for the set of Horn clauses.

The language PROLOG uses resolution on a set of Horn clauses. Each clause is called a program clause. Moreover, clauses composed by a single literal are called facts. A clause with a single negated literal is called a query. The table below shows a comparison of the different notations. In PROLOG, to query a statement $$t$$, the idea is to negate the statement ($$\lnot t$$) and to perform resolution with the set of known true statements. If a resolution refutation tree is found, the statement $$t$$ is implied by the program.

Example: An example of linear resolution for the formula
 * $$\phi = (p)\land (q)\land (r)\land (t\lor \lnot s \lor \lnot r)\land (s \lor \lnot p \lor \lnot q)\land (\lnot t)$$

is shown here:


text:
Cookbook:Outdoor Cooking

Outdoor cooking takes many forms; from basic cooking over a simple camp-fire to gourmet meals prepared on equipment that rivals that found in modern kitchens. Wood, charcoal, propane gas or piped in natural gas may fuel the cooking devices. This is clearly a type of cooking with many variations.

 * Camp Cooking
 * Backyard Smoking
 * Backyard Grilling
 * Backyard Deep-Fry (think deep-fried turkey.)
 * Outdoor Cooking - Misc (Boiled Clams, Crabs, etc.)

General Rules for Outdoor Food Safety
Plan ahead: decide what you are going to eat and how you are going to cook it; then plan what equipment you will need.

 * Pack safely: use a cooler if car-camping or boating, or pack foods in the frozen state with a cold source if hiking or backpacking. Keep raw foods separate from other foods. Never bring meat or poultry products without a cold source to keep them safe.
 * Bring disposable wipes or biodegradable soap for hand- and dishwashing.
 * Plan on carrying bottled water for drinking. Otherwise, boil water or use water purification tablets.
 * Do not leave trash in the wild or throw it off your boat.
 * If using a cooler, leftover food is safe only if the cooler still has ice in it. Otherwise, discard leftover food.
 * Whether in the wild or on the high seas, protect yourself and your family by washing your hands before and after handling food.

title: Cookbook:Outdoor Cooking


text:
Cookbook:Rum

Rum is a liquor made from fermented sugar cane juice or molasses.

title: Cookbook:Rum


text:
Japanese/Pitch accent

Japanese uses pitch accent, where every mora can either be pronounced with a high or low pitch. Not all dictionaries will indicate this, but pitch accent is certainly important, because it can make the difference between different words.

For example, using bold for high pitches:

いま (今) - "now"

いま (居間) - "living room"

Pitch is, however, to some extent a characteristic of regional accents, so a Kanto speaker may be using the opposite pitches to a Kansai speaker. Where pitch is taught, it will be standard Japanese (essentially the Tokyo dialect). Pitchless Japanese is easily understood by native speakers and incorrect pitch will at most sound somewhat odd. Studying pitch, therefore, isn't essential to the learning Japanese and is perhaps best picked up by conversing with native speakers.

Linguists, however, tend to classify Japanese as having a falling pitch following what is considered the stressed vowel.

Mora Counting
A common misconception is that moras in Japanese are the same as syllables in English. Moras differ from syllables because of how they are counted.

Consonant-Vowel Combinations written as Digraphs count as 1 mora. These are cases where you have き、ぎ、し、じ、ち、に、ひ、び、ぴ、み、り combined with や、ゆ、and よ to form Digraphs like きゃ, しゅ, ちょ, etc.

So, the ちゅ in 中国[ちゅうごく] accounts for 1 mora. The whole word is 4 moras.

A vowel combination counts as 2 moras. Combinations like おう、えい are 2 moras. This also includes a vowel being written or said twice, like おお、いい, etc.

Ex. the せい in the word 人生[じんせい] or the おう in だろう would count as 2 moras.

The mora ん counts as 1 mora

Ex. The ん in 先生[せんせい] is the 2nd mora in the word, and the whole word has 4 moras.

The small tsu (っ) which doubles a consonant adds 1 mora.

Ex. the word 学校(がっこう) has 4 moras.

There is a unique set of mora known as "special mora" (特殊拍) which consist of small tsu "っ", the kana "ん" and long vowel symbol  "ー",  the last high pitch can not occur on any of these "special mora".

This is all important information to know when reading pitch accent, and counting Japanese moras.

Pitch classification
When dictionaries give pitch accent, they'll usually indicate it with a number. The number tells you the mora where the last high pitch is. To figure out the pitch pattern, put a low onto the first mora (unless the last high pitch is on that mora), put high pitches onto all the mora that follows, until you hit the last high pitch. After that, put low pitches.

Even more helpful dictionaries will do all of this work for you, by telling you exactly where all the pitches rise or fall.

So, to give some examples.

Notice how ともだち (0) and おとうと (4) look as though they have the same pitch pattern despite the different numbers. The difference is based on the grammatical pattern like -は added afterward. Therefore, the continuation of both pitch pattern becomes ともだちは and おとうとは.

title: Japanese/Pitch accent


text:
LaTeX

This is a guide to the LaTeX system. It is intended as a useful resource for everybody, from new users who wish to learn, to old hands who need a quick reference.

TeX and LaTeX

TeX is a typesetting computer program created by, originally for his magnum opus, . It takes a "plain" text file and converts it into a high-quality document for printing or on-screen viewing. LaTeX is a macro system built on top of TeX that aims to simplify its use and automate many common formatting tasks. It is the de-facto standard for academic journals and books in several fields, such as mathematics and physics, and provides some of the best typography free software has to offer.

This book is organized into different parts:

 * Getting Started will provide you with the very first steps to print your first document, from installing the needed software to basic concepts and syntax.

 * Common Elements discusses common features you would expect from a document processor, including fonts, layout, colors, lists, and figures.

 * Mechanics are some topics that are not really necessary to write a basic document, but could help you understand how some parts of the system work. These topics are required for fine-tuning documents. Use them as support for various chapters, as they are often being referred to.

 * Technical Text focuses on different specialized matters, mostly for scientific work.

 * Special Pages is for the structured pages usually put in appendices.

 * Special Documents: this part tackles other kind of documents different from the classic article style.

 * Creating Graphics is for the process of writing graphics from a LaTeX document.

 * Programming or how to create your own macros and packages.

 * Miscellaneous contains everything that does not fit in the previous parts, like project management and other subjects related to LaTeX but not inherent to LaTeX itself.

 * Help and Recommendations : the FAQ encompasses very common pitfalls and important recommendations for everyone, we urge you to read it; the Tips and Tricks are much more specific matters.

 * Appendices.

Contents

[ Edit the TOC or the stages]

Other Wikibooks

 * TeX
 * LaTeX in Haskell
 * ConTeXt

লাটেক LaTeX-Kompendium Manual de LaTeX fa:لاتک LaTeX ԼաՏեԽ לאטך LaTeX TeX/LaTeX入門 LaTeX Latex LaTeX LaTeX LaTeX Latex LaTex LaTeX

title: LaTeX