text:
Windows 10+ Recovery Environment (RE) Notes

Summary and Basics

 * The Windows Recovery Environment (RE) is a computer's restoration platform.  It is a collection of tools with a graphical interface that can repair a computer, or reinstall it from saved images.  It can also use an USB recovery drive, so that work can be done externally to the Windows environment.
 * The Winre.wim file is its core, and It is an image file.
 * It is normally hidden from view, but can be seen in Windows Explorer when the folder options are adjusted, and the recovery partition is given a drive letter.
 * Winre.wim is initially located in folder \Windows\System32\Recovery, for staging or when disabled. When the RE is clean-installed or otherwise enabled, tt is moved to folder \Recovery\WindowsRE, in the recovery partition with two other files.
 * The file depends on finding the specified folder at its destination. For a clean installation, the empty folder tree at the working location must be prepared prior to initially enabling the RE.
 * The Reagent.xml file is also located in \Windows\System32\Recovery, and travels with the Winre.wim file.  When it is missing in Windows 10 and beyond, a new one is made automatically for the current configuration.  Before Windows 10, handling procedures can differ.
 * The Recovery Environment (RE) can be switched on and off.  If it is off, (disabled), most facilities will be unavailable.  it will not be possible to make a recovery drive, access advanced options, or install a system image.   When the recovery environment is switched on, (enabled), a full set of advanced tools is available.
 * When the recovery partition is unsuitable for the RE, C:\Recovery\WindowsRE is used instead.  However, when the problems with the partition are corrected, the RE can be redirected back to the partition, using an entry made at an elevated command prompt.
 * When the Recovery Environment is disabled, the Winre.wim file is moved back to its staging location in the \Windows\System32\Recovery folder.  (See Figure D).   It is then moved back to its working location when it is enabled.
 * A USB recovery drive can override RE settings. Booting with a recovery drive can access a full set of advanced options even when the computer's RE is disabled. (See later).
 * Reagentc.exe is used to switch the RE on and off.  It is also used to check its status, and to tell the system where to install the RE files. It is accessed in an elevated command prompt, and a detailed log of its actions is always available at C:\Windows\Logs\Reagent.log.
 * Users sometimes need to work on the hidden recovery partition. Assigning a drive letter, viewing files, and extending the partition are the main tasks that users might encounter.  All of these tasks can be carried out in Windows, but are more easily done with a third party partition tool.   Even free tools, like MiniTool Partition Wizard Free Edition, are easier to use than Windows.
 * The RE does not normally need manual intervention. The configuration files are automatically updated by switching the RE from the disabled state to the enabled state, or by notifying a change in the location to send the RE.  In Windows 10, a new xml file is made if one cannot be found. If necessary, when things still go wrong, there are commands that can be used to check and change the status of the RE, and to tell the system of the new location for its working files.
 * A good way to reinstate the integrity of the Recovery Environment is to allow the installation of a Windows Feature Update.  Because the update needs the RE to do its work, it will be sure to reinstate it.  Another, more timely method is to perform a clean installation of the RE. (see later).
 * A copy of the Winre.wim file should be kept as a backup.  If a Winre.wim file is thought to be defective, the backup copy could then be used to reinstall the RE.   Copies can also be imported from other computers, or from installation and system images, but having a backup is more convenient.   There is no need to backup the reagent.xml file in Windows 10 as the system can make a new file every time the RE is enabled.
 * The Windows USB Recovery Drive can give full RE access, even when it is disabled, so a USB Recovery Drive is well worth the time in its making. Such a drive can be used to boot (load) a PC into Windows even if the PC cannot start on its own.  It can also boot the PC into a full version of the Recovery Environment.  Running the RE on a USB Recovery Drive can allow the installation of system images at times when other methods would fail.   It cannot transfer a WindowsBackupImage onto a new, blank hard drive however, since some preparation of the disc's partitions must still be made.   For a blank hard drive, cloning or the use of installation media are still the preferred methods.

Accessing the Recovery Options
There are several ways to access the recovery options. (See Figure A.)  Some use keys during startup, and some others a modified form of restart. These methods set flags that cause the relevant boot loaders to load the Recovery Environment instead of the Windows operating system. The most reliable methods are given here.

Starting the RE with Hot Keys
When the PC is switched on or reset, there is an immediate startup phase, in which pressing certain keys on the keyboard can cause the computer to go into the Recovery Mode. For example, some HP computers use the f11 key for this. Other manufacturers will use other keys, but often there is brief message at the bottom of the screen that invites the user to press a certain key for this purpose. At times, recovery mode can be accessed from the Startup menu, accessed on HP computers by pressing the Esc key during startup. Along with the RE startup key, there is also a key to go to the UEFI/BIOS settings; on HP computers it is f10, though it too changes between manufacturers. Refer to documentation for your PC to learn correctly which keys to use. Notice also that the startup keys are still valid whether the PC boots on its own, or with the help of an USB Recovery Drive.

Starting the RE with Shift-Restart
Provided that the PC can start, then the preferred method to enter the Recovery Environment is to restart the PC while pressing the shift key. Power switch restarts can be initiated anywhere that a restart button exists, including the Sign-On screen, the Start Menu, Advanced Startup in Settings> Recovery, and no doubt others.

Starting the RE with an USB Recovery Drive

 * The Use a Device choice (see figure A), runs a version of the RE from the USB Recovery Drive. In this way the USB can perform recovery tasks independently of Windows, and can do so even if the RE in the PC is set to disabled.   In order to make use of these features the user should of course, have a Windows Recovery Drive, made at a time when the PC was working well.   Details on how to make such a drive can be found by searching in Windows for the term Create a Recovery Drive.   The following method although of use generally, is made for a near-worst scenario, where the computer cannot start on its own, the user has forgotten the startup keys, and the computer's RE is presently in a disabled or inoperable state. The sequence of work used to enter the recovery environment, and gain external control of it, is as follows:
 * Set the boot order of the BIOS/UEFI to boot from the USB. That is to say, access the UEFI settings, then move the USB choice to the top of the boot order, then save and exit the UEFI settings.  This should have already been done as a matter of routine, but in case of difficulty, refer to Boot Menu Option Keys for All Computers, for the boot access key on your computer.
 * Switch off the computer. A cold start is best; remove power from the power cord as well, since the mother board has power unless mains power is removed. Press the start switch a few times to discharge any residual power. After a few minutes reconnect the mains.
 * Remove all USB objects except the mouse and Recovery Drive and start the PC.  Do not touch any keys at this stage.  The Recovery Drive should boot the PC into Windows normally.   It is assumed here that the PC reaches the sign-in screen, having run an automatic startup check and repair.   Note: If you know the key to press to enter the RE during startup, and don't need start-up repairs, then press that key during startup, and skip to making the "Use a device" item below.
 * Perform a Shift-Restart from the sign-in screen. That is, hold down the shift key while selecting restart on the lower-right power button.   A similar procedure could be performed at any other point on the PC where there is a power button.   The computer restarts, booted by the Recovery Drive, and opens a reduced version of the Recovery Environment; this version has very little other than that available in a boot menu, but additionally includes the "Use a device" option.
 * Find and select the option Use a Device. From the three or so options then presented, choose the one for the removable USB drive. The PC will automatically restart, and the Recovery Drive will open a full set of options of its own, the first of which is a language selection.
 * The language screen is characteristic of USB control, there being no other notice as to which device is now running the RE. When making selections from these options, the Recovery Environment will make use of tools in the Recovery Drive, as opposed to those in the PC or Windows.  This would even permit the formatting of Windows if deemed necessary.
 * Remove the Recovery Drive from the USB slot. Do this when it is no longer needed, and before proceeding normally to Windows again. This avoids another unnecessary USB boot into the RE.

RE Management with Windows Explorer
Although enabling and disabling the RE must be done at the Command Prompt, searching for files can always be done from within Windows Explorer. If work needs to be done directly in the recovery partition however, a drive letter will need to be assigned. (See later). For some actions that will not be necessary. In general, the user should consider logging on as an administrator, and in any case adjust the folder options as follows:
 * Go to Windows Explorer's View drop menu.
 * Select the Options tile, then Change folder and search options.
 * In the dialog that opens, select the View tab, then check Show hidden files, folders and drives.  In addition, ensure that the Hide protected operating system files (Recommended) remains unchecked.
 * Click Apply then OK to quit the dialog.

Search for files
Left-click the C: drive in the left panel then enter the file name and extension in the top-right Search This PC text field, (for example, winre.wim ). Hit Enter to start the search of C: drive. After a while the results list will be completed. Narrow or widen the search locations by choosing a different drive or folder in the left panel, then re-entering the file details.

File Restrictions
Being able to see system and operating files does not necessarily mean that they can be moved or copied. That privilege depends on who the owner is. In the event of such difficulty, the intending user might have to take ownership of such a file or folder, or extend sharing to himself. Use the right-click menu item "Give access to", to give yourself access to some restricted files.

Hidden Partition Working
Before installing the RE in a partition, the system checks to see if the partition is suitable. During the install run, it checks for size and type, and otherwise decides on suitability. If it decides that it is too small for the files and working space, or otherwise unsuitable, it will install the RE into the C:\Recovery folder instead. So, if at any time the RE is found in that folder, it would be best to consider any issues with the partition before attempting to install in it. Microsoft's page on this issue is best, at Disk partition requirement for using Windows RE tools on a UEFI-based computer.

If it is decided to extend the partition, or to work on it, the use of a partition tool is preferred. Even free utilities such as MiniTool Partition Wizard Free Edition permit the assignment of drive letters and the adjustment of a partition's size. They also allow the viewing of files in hidden partitions, using an explore option. These utilities are often simpler to use than those supplied by Windows, but on a cautious note, care is needed in any partition tool's use, since changes made in a casual way can have far reaching consequences.

In order to see and work with any files in a hidden partition, a drive letter must first be assigned. Then the files can be handled in Windows Explorer, in the same way as any others. After a session of work is done, the drive letter can be removed again to make it inaccessible. Before working on any system files, it is advised to set the folder options of Windows Explorer so that system files will be visible and so that operating system files are not hidden. Otherwise, they will be invisible for both viewing and command prompt listings. Similarly, any use of the command prompt should be done at an Admin level, the so-called elevated command prompt, or some commands will not work at all. It might also be as well to sign on to Windows as an administrator for any extended work. This will minimise the requests for permissions.

Making Clean Starting Folders
When attempting to make a clean installation of the RE, it is important to avoid any residual problems that exist in the surrounding files and folders. One way, when it is possible, is to install into empty folders made for the purpose, and to first rename any similar existing folders so that they are unavailable. For example, for a partition, the RE system will install into a specific folder in a specific folder tree, and no other. For a clean installation, the partition must have an empty outer folder in it called Recovery. Within the Recovery folder there must be another empty folder called WindowsRE. If any existing folder tree exists with the Recovery name it should be renamed so that it is unavailable.

Similarly, during the installation of the RE, a Winre.wim image file must initially be located in folder C:\Windows\System32\Recovery. There is no need for any WindowsRE folder at this location, since it is merely a staging location for the wim file, prior to the start of the installation. If there is doubt as to the integrity of the Winre.wim file, then it too should be renamed, and another file that is known to work, brought in to replace it. In Windows 10 and beyond, some files are made automatically when they are not found during an RE installation run. This is not the case for earlier Windows editions. For Windows 10 and 11, this makes it a useful way to exclude such files from adversely affecting the new installation. If there is an existing REAgent.xml file in the C:\Windows\System32\Recovery folder, it must be deleted before a clean install; the system will make a new one on-the-fly, with all of the new configurations in it. Note that a missing Winre.wim file will not be replaced during a run; it must be present at the staging point before enabling the RE.

Checking System Files and Images
At any time, the integrity of the system can be checked by running a file check. That does not mean that the recovery partition will be checked as well. When the RE is disabled, the Winre.wim file is brought back into the C:\Windows\System32\Recovery folder, regardless of where it was located while it was enabled. So prior to running a specific file check it would be best to make sure that the Winre.wim file is conveniently located in Windows, by first disabling the RE. Code for doing this, and other tests, is given in a later section, though recent tests have introduced doubt as to whether or not the Winre.wim file is ever included in a System File Check; no mention of it is ever found in the various logs.

An alternative to file checking is to make use of a Winre.wim file from a known, good Windows computer of the same edition. Another alternative is to allow the computer to do a features update, or an upgrade of Windows. Because the system needs the RE for its updates, it will make sure that there is a working RE by the time it is done. That is not to say that the system will install the RE where you want it; it will not install it into a partition if it was not notified (set) there before. Another way, more complex, to get a file is to mount an installation image so that there is access to its files. The wim file can then be copied, and dismounted after use.

Microsoft recommends running DISM before sfc in Windows 10, so this is the sequence displayed below. The following code can be used at an elevated command prompt to perform more searching tests and repairs on the computer, but should be used sparingly and with caution, in view of the damage that might result from careless use:

To check the Windows image for integrity
The code lines shown here require an online internet connection. They check the Windows files against a reference set of files in a Microsoft server. The first line will check that files are OK without making changes, while the second line will check the integrity of the component store. The third and most useful will check and fix any bad files that are found. The process can take some time since many files need to be checked. Press Enter after any one line of code, then await completion before any other:  Dism /Online /Cleanup-Image /CheckHealth Dism /Online /Cleanup-Image /ScanHealth Dism /Online /Cleanup-Image /RestoreHealth

To perform system file tests and repairs
The first of these two code lines will verify the integrity of the system files but will not make any changes to them. The second line will check such files and also repair or replace them as necessary. A log file for the process is available at C:\Windows\Logs\CBS\CBS.log. Press Enter after any one line of code, then await completion before any other:.  sfc /verifyonly sfc /scannow

To perform hard drive sector tests and repairs
The first of these two code lines will verify the integrity of C: drive's sectors, and will report but not make any changes to them. The second line will check the sectors and also make repairs as necessary. Press Enter after any one line of code, then await completion before any other:  chkdsk /r c: chkdsk /f c:

To obtain a hash for your working Winre.wim file
There is no clear evidence that the wim file is ever checked during a sfc check, so the next best thing is to do a hash of your wim file while it is working well so that you can compare it when it is in doubt. The procedure below first disables the RE to move the wim file into Windows. Then the directory is changed to the folder that contains the wim file, then the hash line is run. Change the MD5 to SHA1, SHA256, or SHA512 for other hashes. The sequence of work is just: Press Enter after each line of code, then await completion before any other:  reagentc /disable cd c:\windows\system32\recovery certutil -hashfile winre.wim MD5 reagentc /enable reagentc /info

To Check, Enable or Disable the RE
At various times we need to disable or enable the Windows Recovery Environment. When disabled, there is no access to the advanced options of the RE without a Recovery Drive, and it is not possible to make such a drive when the RE is disabled. However, at times when repairing the RE, we need to switch it off and on. These commands, as for many others, must be made at an administrator command prompt.  reagentc /info  reagentc /enable  reagentc /disable
 * The RE status tells us whether it is currently enabled or disabled, (see Figure B), and if enabled, what its set location path is.  It is found with:
 * To enable the RE we use:
 * To disable it we use:

Clean Install the RE to a Partition
This procedure is the most general, and as such is easily adapted to address a number of RE problem types. These include but are not limited to:

 * Cannot enable the RE
 * Recovery Environment not found.
 * Confused configuration issues.
 * First time install of RE.
 * RE installed in Windows instead of Recovery Partition.
 * No backup to staging location when disabled.

This description assumes that there is a Winre.wim file available on the computer from some suitable source. That is to say, from a backup copy or a computer of the same edition: Win10 needs a file from a Win10 computer, etc. It further assumes that there is already a recovery partition made, it is hidden, and that after installation of all files, it will still have free space roughly equal to the size of the Winre.wim file itself. A partition size of greater than 1GB would usually do fine. Ideally, the RE partition should be located immediately following the partition in which Windows is installed. For a detailed description of the most general method of RE installation, first refer to Microsoft; Deploy Windows RE.The summary of the procedure is as follows:
 * Prepare Windows Explorer; set the folder options to unhide and view system and operating system files.
 * Prepare the Recovery Partition; give the partition a drive letter. We use "R" for our example.
 * Disable the RE if there is already one installed.
 * Use Windows Explorer” to view the existing Recovery Partition'' files.
 * Rename any existing Recovery folder structure in the recovery partition; eg; make it bakRecovery.
 * Then make sure that the empty folder structure Recovery\WindowsRE exists as a top level folder tree in the RE partition. (See Figure D).   If it does not, then make it.
 * Copy your Winre.wim file to the clipboard, then Paste it into the \Windows\System32\Recovery folder.  This becomes the staging location of Winre.wim. Note that this method is simply considered the most convenient, and that with a little more effort the file could be found and copied into place at the command prompt instead.
 * While in \Windows\System32\Recovery rename any existing REAgent.xml file to make it unavailable. (Note: This advice is for Windows10 and beyond).
 * Set the location for the installation of RE files using reagentc /setreimage /path r:\recovery\windowsre at an elevated command prompt.  The system will make a new reagent.xml file, then add it, the winre.wim file, and a boot.sdi file to the WindowsRE folder in the recovery partition,
 * Confirm the status of the RE with reagentc /info, noting that it is enabled, and that the RE has the installed path as intended.
 * If all is well, then remove the drive letter from the recovery partition.
 * A detailed log file for the process can be found at C:\Windows\Logs\ReAgent\reagent.log.

Command line code related to the clean RE install
 diskpart list drive select drive 0 list partition select partition 4 assign letter=R exit  reagentc /info  reagentc /enable  reagentc /disable <poem style="margin-left:25px;letter-spacing:0.05em;color:green;font-weight:bold;font-family:consolas;font-size:11pt;"> dir /a /s c:\winre.wim <poem style="margin-left:25px;letter-spacing:0.05em;color:green;font-weight:bold;font-family:consolas;font-size:11pt;"> attrib [full path to the FILE whose attributes are to be checked] attrib -h -s [full path to the source FILE to copy] xcopy /h [full path to the source FILE to copy] [full path to destination FOLDER for the copy] attrib h s [full path to the source FILE that was copied] attrib h s [full path to the new destination FILE] <poem style="margin-left:25px;letter-spacing:0.05em;color:green;font-weight:bold;font-family:consolas;font-size:11pt;"> reagentc /setreimage /path r:\recovery\windowsre <poem style="margin-left:25px;letter-spacing:0.05em;color:green;font-weight:bold;font-family:consolas;font-size:11pt;"> diskpart list drive select drive 0 list partition select partition 4 remove letter=R exit
 * To assign a drive letter to the Recovery Partition:    It is best to use a third-party partition tool (recommended), but if the command prompt must be used, enter following code lines at an elevated prompt, one by one, pressing Enter after each.  Note:  For this purpose, we use the letter "R", and assume it is for partition four.
 * To check the status of the RE:
 * To disable the RE:   Enter the following code at the elevated command prompt.
 * To enable the RE:
 * To find a list of Winre.wim files in C: drive: Enter the following code at the elevated command prompt. (See Figure C)
 * To copy a Winre.wim file using Command Prompt: Note: The first line is just used for you to find the file's attributes; it is assumed here that, among others, system and hidden attributes (h and s) were found; these two found attributes are removed in the second line, the xcopy is applied in the third, then the attributes are reapplied at both the new and old addresses. It is easiest to rename and move files in Windows Explorer, but when the command prompt (elevated) must be used, the following code shows the sequence of work:
 * To tell the RE where to place the enabled Winre.wim file:  In this case we assume that the correct place is the recovery partition, and that it has been labelled as "R" drive.  As well as setting up the various configuration files and notifying the system as to where the RE is to be installed, this code line ends by enabling the RE, ready for use:
 * To remove the drive letter from the recovery partition:  Use the third-party partition software for speed and convenience, or repeat the earlier use of diskpart, replacing the lettering line with remove letter=R.
 * To access the log file for any REAgentc process: In Windows Explorer, go to C:\Windows\Logs\ReAgent\reagent.log, and Open with Notepad or Wordpad.

<div style="background:papayawhip;margin:0px;padding-left:10px;padding-right:10px;padding-top:10px;padding-bottom:10px;border:1px solid gray;">

Internal Links

 * Wikibooks: Windows Recovery with an Image  : More information related to installing images with the Recovery Environment


text:
How to Program a TI-83 Plus/Authors & Contributors

This list is updated automatically by AuthorsAndContributorsBot. Please do not update it manually.

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


text:
Chess Opening Theory/1. d4/1...Nf6/2. c4/2...e6/3. Nc3/3...Bb4/4. Bg5

= Nimzo-Indian Defence, Leningrad Variation =

4. Bg5
White decides to match Black pin for pin, and the e4 square is once more a no man's land. More subtle is the fact that Black's knight no longer controls d5 either. For that reason, van der Sterren calls the d5 advance "the point but also the necessary consequence of 4. Bg5." Either 4...h6 5. Bh4 c5 6. d5 or 4...c5 5. d5 h6 6. Bh4 is almost always played.


text:
Chess Opening Theory/1. d4/1...Nf6/2. c4/2...e6/3. Nc3/3...Bb4/4. Bg5/4...h6

= Nimzo-Indian Defence, Leningrad Variation =

4...h6
Black drives the bishop back, so as to gain the ability to play ...g5 and break the pin at a later time. 5. Bxf6 Bxc3 6. bxc3 Qxf6 gives up the bishop pair and lessens White's ability to defend the weak c pawns, especially once they become fixed in place with ...c5, so the only good move is 5. Bh4.


text:
Chess Opening Theory/1. d4/1...Nf6/2. c4/2...e6/3. Nc3/3...Bb4/4. Bg5/4...h6/5. Bh4

= Nimzo-Indian Defence, Leningrad Variation =

5. Bh4
The bishop retreats, since taking on f6 would accomplish nothing. Now Black has the idea of playing ...g5, but he shouldn't be too eager to weaken his kingside right away. The threat of breaking the pin is enough to keep White from playing e4 for now, so Black should address the center. 5...c5, forcing White to advance his d pawn, is the most common move, but 5...b6 is also playable, with Black either fianchettoing after 6. e3 or pushing c5 after all following 6. f3.


text:
Chess Opening Theory/1. d4/1...Nf6/2. c4/2...e6/3. Nc3/3...Bb4/4. Bg5/4...h6/5. Bh4/5...c5

= Nimzo-Indian Defence, Leningrad Variation =

5...c5
Black starts to attack the center. Taking on c5 collapses White's center for no good reason, and after 6. e3 cxd4 7. exd4 d5 nothing is wrong with White's position, but it is tough to see where his advantage lies. The most common reply is therefore 6. d5, claiming space.

Theory table
.

'''1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Bg5 h6 5. Bh4 c5'''


text:
Wikijunior:Raspberry Pi/Raspberry Pi Python GPIO Zero Buzz Wire Game

Tutorial by David Pride Public Domain 26 Oct 2016 www.cotswoldjam.org

This tutorial will cover building your own fairground-style 'buzz wire' game! You will need speakers or headphones to use this tutorial.

The Kit
In your bag you will find the following components:
 * ×5 M2F jumper leads
 * ×1 220 Ω (red red brown) resistor
 * ×1 LED
 * ×1 30 cm (~12 inches) bell wire
 * ×1 10 cm (~4 inches) bell wire
 * ×1 mini-breadboard

Putting it together
Step 1: Take 1 jumper lead and attach it to J6 on the breadboard and pin 7 (GPIO 4) on the Pi.

Step 2: Take 1 jumper lead and attach it to J1 on the breadboard and pin 6 (GND) on the Pi.

Step 3: Take the resistor and insert it into holes H1 and H5 on the breadboard – it doesn’t matter which way round this goes. LEDs are really greedy and will take all the power they can, which could damage the Pi. We use this resistor to limit the power the LED can draw from the Pi.

Step 4: Take the LED and insert it into holes F5 and F6 on breadboard. MAKE SURE THE LONG LEG OF THE LED GOES INTO F6.

Step 5: Take 1 jumper lead and attach it to E1 on the breadboard and pin 39 (GND) on the Pi.

Step 6: Take 1 jumper lead and attach it to E17 on the breadboard and pin 37 (GPIO 26) on the Pi.

Step 7: Take 1 jumper lead and attach to A1 on the breadboard. Now take the short length of bellwire, bend the end carefully around your finger then insert the other end into the free end of the jumper lead you just attached to the breadboard.

Step 8: Take the long piece of bell wire and bend it into an interesting shape. Remember – the more bends you add, the harder your game will be! Then insert the two ends of this piece of wire into A2 and A17 on the breadboard.

Step 9: Hook the loop you made in the short wire over one end of the bendy wire like this. Your Buzz Wire game is now complete! – Grab a tutor and ask them to check the connections now.

The program
Power up your Raspberry Pi. From the desktop menu, select Programming – Python 3 (IDLE). Then use File, New Window to create a new program.

Type in the following program, or alternatively you can use File, Open to open the  program in the Desktop/buzzwire folder.

Use File, Save to save this program as  in the Desktop/buzzwire folder and then run it with Run menu, Run Module.

What does the program do?

The first three lines tell the computer to learn about new things. Computers can learn from programs that other people have written; we call these other programs "libraries". Our instructions tell the computer to learn how to run other programs (such as the sound player) from the  library, and how electrical buttons work (two wires touching) from the GPIO Zero library.

We then create a  object and an   object. We say the button is connected to pin 37 (GPIO 26) and the LED to pin 7 (GPIO 4).

This next line tells the program to run forever in a loop.

Next, the program runs until the wires touch. It then prints a message and plays the sound file.

Finally, the program waits for one second, then turns off the LED so play can continue.

Buzzwire-gpiozero.pdf
The original PDF for this tutorial is available on Wikicommons:


text:
Infrastructure Past, Present, and Future Casebook/Venetian Flood Control (MOSE)

This is a case study on the Modulo Sperimentale Elettromeccanico (MOSE), Experimental Electromechanical Module, by Julian Klien, Samuel Gray, Lucas Suter, and De'Elian Paul. As part of the Infrastructure Past, Present and Future: GOVT 490-004 Synthesis Seminar for Policy & Government / CEIE 499-001, Special Topics in Civil Engineering, Fall 2022 capstone course at George Mason University's Schar School of Policy and Government and the Volgenau School of Engineering Sid and Reva Dewberry Department of Civil, Environmental, and Infrastructure Engineering. Modeled after the Transportation Systems Casebook under the instruction of Prof. Jonathan Gifford.

Summary
The MOSE (Modulo Sperimentale Elettromeccanico, Experimental Electromechanical Module) project is an attempt to prevent flooding in the city of Venice, and its surrounding villages, through the installation of 78 mobile gates or barriers which will separate the Venetian Lagoon from the Adriatic Sea. It was also made to resist waves up to 3 meters (9.8 ft) above the normal tide levels. The MOSE has the ability to prevent floods during acqua alta (a period of high-water flooding from October-March in the Adriatic Sea). With barriers at 3 different locations ranging from 20-30 meters in length.

Consorzio Venezia Nuova has been entrusted to carry out the project by the Venice Water Authority. The construction work on the project began in 2003, after much delay it is expected to be ready for use in 2023. When completed, it will safeguard Venice and the villages located within the Venetian Lagoon from flooding, and prevent the further rise of the sea level to protect industries such as tourism, trading, and others.

The MOSE is a major infrastructure project, as it has been tasked with protecting Venice, a city that is important to all of society for its abundance of history. In addition, MOSE battles an increasing problem for coastal cities and settlements across the globe in rising sea levels. If successful the project provides itself as a potential blueprint to help coastal settlements. Despite its significance, it has that has been marred by many complications. Deterrents like corruption, extremely long delays, a ballooning budget, and negative environmental impact have overshadowed the potential good it could do for Venice.

History
Early Venetian History

Venice was founded in the fifth century as refugees from Lombard conquests settled on the 118 islands that spread across the Venetian lagoon.1 For the first centuries of its history, the city shifted hands between the Byzantine Empire in the East and the various Frankish kingdoms that at different times ruled Italy in the East. The city’s location between two empires gave it increased political importance, and this combined with a period of political stability beginning in the 9th century led to the formalization of the city as an independent state ruled by an elected Doge in 1032. This election led to centuries of Venetian dominance in Mediterranean trade and gave it its status as a crucial port city.2 The level of water in the lagoon has always been a concern, but historically a lack of water has been a greater concern than any flooding.3

MOSE Becomes the Choice for Venice

Following the 1966 flood, solutions to rising water levels in the city were stalled by political fights for seven years. Finally in 1973, a law was passed opening the government to proposals of ways to save the city from the sea. By 1980 six of these proposals had been accepted under the auspices of Consiglio Nazionale delle Ricerche (CNR), a government science and technology research commission. They transferred authority over the proposals to the Ministry of Public Works later that year, and by 1981 the ministry proposed the setting up of fixed and mobile barriers at inlets into the lagoon to prevent flooding. From 1982 to 1989 the corporation Consorzio Venezia Nuova went through the process of designing a proposal for the project. In 1994, the Higher Council of Public Works approved the project, and following an environmental impact survey, construction began on MOSE in 2003.5 Between the great flood that inspired the project and the breaking of ground for its construction, 37 years had passed.

Environment and Venetian Lagoon
Geography and Location The city of Venice sits in the Venetian lagoon, with the many islands inside the lagoon itself. This environment was created due to the settlement of sediments along the coast, river and sediment runoff, land subsidence, anthropogenic factors, and with the effect of waves and currents from the Adriatic Sea. The lagoon is separated from the sea by three inlets – the Chioggia, Malamocco and Lido. These inlets are also the routes for water, and ships to enter and leave the lagoon.

Modern Issues with the Lagoon

In the modern era, flooding has been far more of a concern than low water level for Venetians. Since 1923, when records on floods in the floating city first began, its squares and buildings have filled with water a number of times. The two most notable incidents of modern Venetian flooding are the great floods of 1966 (still the highest water has ever risen in Venice with 194 cm above sea level) and 2019 (which came within 7 centimeters of the record). It is this modern flooding, exacerbated by climate change, that cause the city to seek a new technological solution to their problems beginning with the 1966 flood.4

Environmental Causes for the Floods

Several factors must occur for floods to develop in Venice. There are environmental factors mainly within the Venetian lagoon, the Adriatic Sea, and the meteorological phenomena in the Mediterranean Sea and Southern Europe. First, the sirocco winds, hot air winds, coming from northern Africa mix with the cooler air above the Mediterranean Sea.17 These winds then mix cooler winds from Eastern Europe along the Adriatic Sea until they reach the Venetian Lagoon. Second, after the sirocco winds mixed with the cooler winds reach the lagoon, high tides push even more water into the lagoon and “trap” the water from going back into the Adriatic Sea. Third is the settlement of the land itself, which occurs to soil after a prolonged period due to man-made construction. A century ago, the sea level was 27 centimeters (about 10.63 in) lower in the city and lowering by about 1 mm (about 0.04 in) every year.17

Anthropogenic Causes for the Floods

When the settlers first decided to establish themselves in the lagoon, they had to find ways to do it in what were marshes, mud flats, swamps, and soft soil. To accomplish this, the settlers decided to dig in and shove logs into the mud to create a foundation for the buildings19. This was a genius idea at the time. The logs did not rot due to having no contact with oxygen, and instead hardened over time. However, like with any building, settlement occurs, and the foundations start sinking.

MOSE Characteristics and Functionality
Objective and Purpose

MOSE is designed to stop floods from occurring in the city of Venice and it can resist waves up to 3 meters (9.8 ft) above the normal tide levels. MOSE is capable of preventing floods during acqua alta (a period of high-water flooding from October-March in the Adriatic Sea). The deployment of MOSE, is a response to water levels above 110 cm (3 ft 7 inches approximately), which can alter daily activities for citizens, tourists and port activities.

Operational Aspects MOSE consists of 78 mobile barriers, located underwater when not in operation. The barriers are placed at 3 different entrances into the lagoon. Each barrier is 20-30 meters in length (66-98 ft) and 20 meters wide depending on the necessity, the MOSE barriers can be deployed at different times. However, it takes the barriers 30 minutes to be fully raised and 15 minutes to restore the barriers to its resting position

To elevate the barrier's, a decision is made within the control room from the data presented to the operators. Once the decision to raise the barriers is made, compressed air is sent into the barriers driving out the water that once kept the barriers submerged. This causes the barriers to emerge above the surface within 30 minutes. The average inlet closure into the lagoon, is approximately 3-5 hours. To lower the barriers, water is allowed back into the barriers, releasing the air and causing the barriers to submerge back underwater into its resting position within 15 minutes.

MOSE has a safety increment in place, in order to counter unnecessary deployments. This parameter is put in place because it compensates for potential daily tidal forecast mishaps, in accordance with the sea level within the lagoon. As forecasters place a 10 cm parameter upon their predictions, the MOSE system operators are believed to add an additional 10 cm deviation to add more buffer for potential mistakes

MOSE Failures

Due to inaccurate data, MOSE has been bypassed by high-tides as a result of the system operators being given inaccurate information on the incoming weather/water forecasts. Researchers have a belief that the deployment of MOSE could have a negative effect on the sediment deposit located within the lagoon in the future. As the disruption of the natural events occurs, the lagoons ecosystem would suffer as a repercussion. The more MOSE is being utilized; the harbors activities are hindered because of the barrier's denial of entry

When is MOSE expected to be fully operational?

Expected to be fully operational December 2023 after several delays.

Construction
Construction on the project began in 2003 under the control of the Consorzio Venezia Nuova, a subset of the Ministry of Infrastructure and Transportation.1 Funding for the project came from two main sources. First, the Interministerial Committee for Economic Programming disbursed 3.8 billion of the project’s 7 billion Euro price tag in a series of installments beginning in 2002 and ending in 2011. The remaining funds were provided by the Committee for Policy, Coordination, and Control.2 The project was initially set for completion in 2011. However, delays caused mainly by problems with erosion have continued to push back this date, and it now seems the project will be completed in 2023.3 The repeated delays, corruption issues, and cost increases have generated much controversy around its construction, and the arrest of dozens of government officials. Sections of the project were successfully tested in 2020, however, and it does seem like the project will truly be up and running this year.4

Criticism
MOSE is not without its critics. The controversies mentioned above have made many in the Italian public view the project as a waste of time and money, as well as an avenue for government corruption. Additionally, when the project is finally completed, there are many who say it will be more trouble than it is worth. The crucial gates that will be raised to keep rising waters out of the lagoon will also keep water inside, creating concerns about sewage buildup that could kill the region’s ecosystem.

Furthermore, the gates are not activated until water rises higher than 110 cm, 20 cm higher than the level necessary to flood such Venetian landmarks as St. Mark’s Basilica. There are concerns that even when the project is completed, it will not be able to stop the perpetual low-level flooding that could become Venice’s reality by 2100.5 Venetians have expressed their opposition to this project in protests like one that occurred in November of 2019. A memorable image of this protest is demonstrators marching through the highest floodwaters the city had seen in decades as they opposed the only plan the government has had to deal with them since 1982.

Economic impact and Public opinion
Economic Since the MOSE won’t be fully operational it wouldn’t be possible to tie an exact number to its economic contributions. Yet, once it is functioning it will be indirectly contributing billions of dollars by protecting the future of industries that are reliant of the coastal area’s physical attributes. One industry that will greatly affected is tourism, an industry, that provides around 2 billion euros to the city. Due to its famous Italian architecture and world renown beauty the city attracts over 20 million visitors annually. If the city continues to sink the tourism industry will be negatively impacted as people won’t be able to walk around and sight-see, spend money at local restaurants, shops, hotels, and other places of business placing a large hit on the city’s profits.

Though, the project has been financially taxing as it once was projected to cost 1.8 billion euros skyrocketed to 5.2 billion euros in 2014.23 The price has again increased in recent times as the total price come out to around 7 billion euros. Lastly, there is speculation that there will be a small increase in cost for port activities as the mobile barriers cause delays in entering and exiting the lagoon.

Social impact

The MOSE project has already begun to receive criticism from the public for its delays, costs, and more infamously corruption. Starting in 2013 there were arrest made on charges of embezzlement, laundering, fraud, and corruption.22 The accused group of 35 people included entrepreneurs, politicians, and bureaucrats.23 Investigations revealed that 25 million euros of illicit funds were channeled through the project. In addition that 1 billion euros have been stolen from the project's funds since the start of construction.

In addition, the public is concerned it won’t properly protect against flooding to preserve the architecture that’s made the entire city and its lagoon a UNESCO heritage site. The MOSE’s existence was partially created was to keep the city from major floods, in order to keep its lucrative tourism industry alive, which has become a problem for the locals of Venice. The city of Venice and its citizens have suffered from over tourism it has contributed to overcrowding, increase of cost of living, and environmental degradation. So, the MOSE protects an industry that negatively affects the local's quality of life. Despite that, it is an attempt to protect the tourism and trade industries that thousands of Venetians rely on for jobs.

Discussion Questions
Should the Venetian government abandon funding the MOSE development, as it may bring relief to businesses and protecting the city but could have irreversible damages to the lagoon's ecosystem?

Should Venice and its citizens start thinking about life after the sea level reaches a height where life is no longer possible in the city?

Since the entire of city of Venice is a UNESCO World Heritage site, should other countries help fund MOSE to preserve it?


text:
User talk:192.19.200.1

Life Lesson
Judge a cover by its book other way round huh shit ain't right

title: User talk:192.19.200.1


text:
C Programming/GNU C Library Reference/argp.h

Next: Parsing of Suboptions, Previous: Parsing program options using, Up: Parsing Program Arguments   [Contents][Index]

Parsing Program Options with Argp
Argp is an interface for parsing unix-style argument vectors. See Program Arguments.

Argp provides features unavailable in the more commonly used  interface. These features include automatically producing output in response to the ‘ --help ’ and ‘ --version ’ options, as described in the GNU coding standards. Using argp makes it less likely that programmers will neglect to implement these additional options or keep them up to date.

Argp also provides the ability to merge several independently defined option parsers into one, mediating conflicts between them and making the result appear seamless. A library can export an argp option parser that user programs might employ in conjunction with their own option parsers, resulting in less work for the user programs. Some programs may use only argument parsers exported by libraries, thereby achieving consistent and efficient option-parsing for abstractions implemented by the libraries.

The header file  should be included to use argp.

 * The  Function
 * Argp Global Variables
 * Specifying Argp Parsers
 * Specifying Options in an Argp Parser
 * Argp Parser Functions
 * Combining Multiple Argp Parsers
 * Flags for
 * Customizing Argp Help Output
 * The  Function
 * Flags for the  Function
 * Argp Examples
 * Argp User Customization
 * Parsing of Suboptions Example

25.3.1 The Function
The main interface to argp is the  function. In many cases, calling  is the only argument-parsing code needed in. See Program Arguments.

 * Function: error_t argp_parse (const struct argp * argp, int argc , char ** argv , unsigned flags , int * arg_index , void * input )
 * Preliminary: | MT-Unsafe race:argpbuf locale env | AS-Unsafe heap i18n lock corrupt | AC-Unsafe mem lock corrupt | See POSIX Safety Concepts. The   function parses the arguments in argv, of length argc , using the argp parser argp . See Specifying Argp Parsers. Passing a null pointer for argp is the same as using a   containing all zeros.  flags is a set of flag bits that modify the parsing behavior. See Flags for  . input is passed through to the argp parser argp , and has meaning defined by argp . A typical usage is to pass a pointer to a structure which is used for specifying parameters to the parser and passing back the results.  Unless the   or   flags are included in flags , calling   may result in the program exiting. This behavior is true if an error is detected, or when an unknown option is encountered. See Program Termination.  If arg_index is non-null, the index of the first unparsed option in argv is returned as a value.  The return value is zero for successful parsing, or an error code (see Error Codes) if an error is detected. Different argp parsers may return arbitrary error codes, but the standard error codes are:   if a memory allocation error occurred, or   if an unknown option or option argument is encountered.

Next: Parsing of Suboptions, Previous: Parsing program options using, Up: Parsing Program Arguments   [Contents][Index]


text: Minecraft/Frog

title: Minecraft/Frog


text:
User:Kobi Rubel Ahammed

কবি রুবেল আহম্মেদ

title: User:Kobi Rubel Ahammed


text: User talk:38.140.189.114

title: User talk:38.140.189.114


text:
Wikijunior:Raspberry Pi/Scratch Game – Math Quiz

Description
This is a Scratch game that challenges the player to a series of multiplication questions.

They have to provide the correct answer before a dropped Ball reaches the bottom.

The catch is, as they play the Ball drops faster and faster.

Walkthrough
Delete the "Scratch" character sprite, add a new sprite from the library and choose the item that will drop (for example the "baseball" from the Things folder), from now on I will call this the "Ball" sprite.

Click on the Stage, select "Backdrops" and choose a suitable stage.

From the Variables category, create the following 5 variables:

 * – This is the game level and will control how fast the Ball drops.
 * – This is the player's score.
 * – This indicates when the game is running.
 * – this is the first number to multiply.
 * – this is the second number to multiply.

1. Create the Ball Drop Sequence
First, we are going to create the Ball drop sequence:

Select the Ball sprite, and check that the "scripts" tab is selected.

From the Control category, select the "when I receive …" block. Then select the drop-down and enter a message of "startDrop".

Move the Ball so that it is very near the top of the "stage", but not touching it. From the Motion category, drag "go to x: … y: …" and lock it below the event placed above (your x: and y: might be slightly different from mine).

We want to move the Ball down the screen until it reaches the bottom. We will use a "forever if" loop to do this.

From the Control category, drag "repeat until …" and lock it below the "go to …" block.

From the Sensing category, drag "touching …" and place it in the condition area of the "repeat until … " block. Select "edge" from the drop-down list of the "touching …" condition.

From the Motion category, drag the "change y by …" block inside the repeat loop. Change the value to "-10" (this is how far the Ball will move down each time around the loop).

From the Control category, drag the "wait 1 secs" block and place it inside the repeat loop after the "change y by -10" block.

To calculate the speed of the Ball we will use the following formula:

This will make the Ball drop faster as the level increases.

From the Operators category:

Drag "… + …" and use it to replace the (1) of the "wait … secs".

Now drag "… * …" to the second part of the "… + …".

Finally, drag "… - …" to the second part of the "… * …".

Now fill in the values for our formula above. (You might want to try changing these values later to make the game easier or more difficult.) These are all actual numbers except for the " " variable that you need to get from the Variables category.

If this "repeat until …" loop finishes then the Ball has reached the bottom and the game is over. From the Looks category, select the "say … for 2 secs" block and lock it after the repeat loop, changing the " " to a " ".

Then from the Operators category, drag the "join hello world" and place it inside the "Say" block. Replace the "hello" with "Game Over, you scored: ". Replace the "world" with the " " variable from the Variables category.

From the Variables category, drag "set … to …" and lock it under the "say …" block. From the drop-down select " " and leave the value as " ". This will indicate that the game has finished.

2. Test the Ball Drop Sequence
From the Control category, drag "when space key pressed" to the script area.

From the Variables category, select "set … to …" and lock it below "when space key pressed".

From the drop-down select " " and leave the value as 0 (this represents the starting level). Now, from the Control category, drag "broadcast startDrop and wait" and lock it under the "set level to 0" block.

Now pressing the space bar will run your Ball drop sequence. Try it out, this is the slowest speed. Will you be able to answer a maths question before it gets to the bottom?

Now change the value of the "set level to 0" block to " " (this represents the highest level, the fastest Ball drop) – Do you still think that you'll have enough time? Well, you’ll find out later.

3. The Math Question Sequence
Start a new script by dragging the "when the button clicked" event from the Control category, to the script area.

We need to start by resetting the variables. From the Variables category, drag three "set … to …" blocks under the "when clicked" block. From the drop-down, change the first one to " " and the second one to " ", leaving both of these at zero. Set the drop-down of the third one to " " and set it to " " (this indicates that the game is active).

Now drag a "repeat until …" block and place it below the variables. This is the main loop for each question.

Drag a "… = …" block from the Operators category. From the Variables category, drag the " " variable to the left-hand side of the equals operator. Set the right-hand side to " ". Note that we have just set  to " " and will keep our quiz running until   = " ".

We now want to choose two numbers for our quiz question. Drag two "set … to …" blocks and place them inside the "repeat until loop". Select " " in the first drop-down, and " " in the second drop-down. Now drag a "pick random … to …" from the Operators category, to each "to" value in those blocks. Set the values to " " and " " for each "pick random" (" " would be too easy).

Now drag a "broadcast …" from the Control category, and select "startDrop" in the drop-down. This will start the Ball falling! Now drag a "ask … and wait" block from the Sensing category, and place it under the broadcast message. From the Operators category, drag a "join …. …." block and place it in the "ask" block, then place another "join …" on the right-hand side of the first join, and yet another "join …" in the right-hand side of that one. We can now join four things together. Set the first "join" cell to the words "What is " (put an extra space after the word "is"). Drag the variable " " to the next cell of the join. Then put the word " times " in the third cell (with a space before and after it), and finally drag the variable " " to the last cell. This script will now wait for the player to answer the question, but remember that the other script is continuing to make the Ball drop! Time will be running out for the player. We need to keep asking the player for an answer until they get it right, so drag another repeat loop and place it under the "ask" block but inside the existing "repeat until …" loop. There are two reasons why we must stop this loop; either the player is out of time, or the player has got the correct answer. Drag an "… or …" block from the Operators category, and place it in the "repeat until" condition box. Now drag an "… = …" block into each side of the "… or …" block.

For the first reason to stop this repeat loop, we want to check for when the " " variable is " " (zero).

For the second reason to stop this repeat loop, we want to check when the answer is correct. Drag the "answer" element from the Sensing category to the left side and drag a "… * …" element from the Operators category, to the right side. Put the " " and " " variables in the "… * …" element.

When the player gets the answer wrong we want to tell them and ask them the question again. Right-click on the "ask.." section that you’ve already created and select "duplicate". Place it in a clear area. Note that this has also duplicated the "repeat loop", which we don't want, so detach that and discard it. Change the text in the first cell so that it reads "Try again, what is ", now place it inside the repeat loop. Our program will now keep asking until either the time runs out, or gives the correct answer. Now we need to check to see if the player has got the answer right. From the Control category, drag an "if … then" block and place it under the inner repeat loop, but inside the outer repeat loop. From the Operators category, drag a "… = …" block into the "if" condition.

From the Sensing category, drag the answer into the left side of the "… = …". From the Operators category, drag a "… * …" into the right-hand side. Now from the variables place "first" and "second" on either side of the multiple block.

If the answer is correct, then we want to increase the score. From the Data category, drag a "change … by …" inside the "if" block, select " " from the drop-down and set the amount to " ".

We also need to increase the level (which will make the Ball drop slightly faster), but only up to the highest level possible. From the Control category, drag an "if … then" block and place it under the "change score …" block, but still inside the existing "if" block.

The level can only be increased to a maximum value of 20, so from the Operators category, drag a "… < …" to the "if" condition. From the Variables category, drag the " " variable to the left-hand side of the "… < …" and set the right-hand side to " ". From the Variables category, drag a "change … by …" inside the "if" block. select " " from the drop-down and set the amount to " ".

You can now test your game, what score can you get? How can you make the game easier or more difficult?

4. Further Activities
Add sounds when the player gets a question wrong or right and when they lose the game.

Change the game so that it asks you a different maths question (for example to sum three numbers).

ScratchGame-MathQuiz-Pi.pdf
The for this tutorial is available on Wikicommons.


text:
Chess Opening Theory/1. d4/1...Nf6/2. c4/2...e6/3. Nc3/3...Bb4/4. Bg5/4...h6/5. Bh4/5...c5/6. d5

= Nimzo-Indian Defence, Leningrad Variation =

6. d5
White advances his center. If he can later play e4, it will be hard for Black to shake off his lack of space. Still, playing ...exd5 now and giving white a central majority would be a drastic step. Instead Black usually opts to play around White's d pawn, with ...d6 preparing ...e5, but there is another option: the so-called Averbakh Gambit. Black can sacrifice a pawn with 6...b5 7. dxe6 fxe6 8. cxb5, after which he can take the center with ...d5 and bring his rook to the half-open f file with ...O-O; the stray white pawn is usually disposed of by ...a6.

Theory table
.

'''1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Bg5 h6 5. Bh4 c5 6. d5'''


text:
Wikijunior:Raspberry Pi/Scratch Game – Simple Maze

Tutorial by Andrew Oakley Public Domain Updated Nov 2017 www.cotswoldjam.org

Getting started

1. Click on the Raspberry menu, Programming, Scratch.

2. Click the Maximise Window button.

3. Select File menu, Open.

4. Click the Pi button.

5. Select Scratch and click OK.

6. Select simple-maze and click OK.

7. Select smaze1 and click OK. A green and blue maze should appear.

You should now be able to move the Smiley left and right, using the left and right  arrow keys.

is a "variable". A variable can hold a number or a word which can change. measures the left and right positions.

You should now be able to move the Smiley up and down, using the up and down  arrow keys. The  variable measures up and down position.

The Smiley can now move anywhere around the maze, including through the walls.

We need to add rules

 * To make the Smiley go back to the start if it hits a blue wall
 * To say "You win!" if the Smiley reaches the white outline of the exit

Create this new block

To select a colour
1. Click the colour box.

2. Click the colour you need.

To start a new game
Click the green flag.

What if you make a mistake?
Right-click any block and click "delete".

For teachers / Scout / Guide leaders
Downloads available from http://www.cotswoldjam.org/downloads/beavers

To add the files to Raspbian, go to the Terminal:

Note that  is the capital letter O, not zero.

cjam-scratch-simple-maze.pdf
The original PDF for this tutorial is on Wikimedia Commons:


text:
User:Andrepoiy

Hello! Lurking here from Wikipedia

title: User:Andrepoiy


text:
User talk:Nsondepartur

Welcome, Nsondepartur!

If you have any questions, you can ask in the assistance reading room or possibly contact me personally. —Justin ( koavf ) ❤T☮C☺M☯ 02:28, 8 November 2022 (UTC)

title: User talk:Nsondepartur


text:
User talk:Tugreidz1

--Xania   talk 05:45, 8 November 2022 (UTC)

title: User talk:Tugreidz1


text:
Talk:Chess Opening Theory/Great Big Opening Survey

How often is this GBOS updated?
On the 10th of January 2018, there was 396,710 1.e4 games according to the chessgames database. Now there is 542,458 1.e4 games. Is the GBOS regularly updated? D0arnmaz1e (discuss • contribs) 07:48, 8 November 2022 (UTC)

All pages as of 17.12.2022
Chi Sigma (discuss • contribs) 21:38, 17 December 2022 (UTC)


text:
Minecraft/Charcoal

Charcoal is a good substitute for coal, as it can be used for all crafting recepies coal is in, exept for block of coal.

Obtaining
Smelt logs in a furnace to get charcoal. It is a good substitute for when you have no coal.

title: Minecraft/Charcoal


text:
Minecraft/Coal

A common, useful mineral that can be used as furnace fuel.

Obtaining
Coal can be obtained by mining coal ore underground.

Use
Can be used as fuel.

title: Minecraft/Coal


text: Category:Book:Minecraft: Bedrock Edition Creator Documentation


text:
Wikijunior:Raspberry Pi/Raspberry Pi Temperature Sensor

Tutorial by Andrew Oakley Public Domain 2 July 2016 www.cotswoldjam.org

Getting started
This tutorial shows you how to make a temperature sensor which shines red when hot, and blue when cold.

At the end of each line, press Enter.

Your tutor should have prepared your Raspberry Pi for you and given you a bag of components. Alternatively, you can download the files from: http://cotswoldjam.org/tutorials

Temperature sensor
A DS18B20 waterproof temperature sensor. It has three wires at one end and a metal sensor on the other end. This version is waterproof and the sensor can be dipped in water. A smaller, cheaper, non-waterproof version is also available.

Breadboard
A mini breadboard. This has a top and bottom section. All the points along each column in each section are joined, so we can make electrical connections.

Resistors
Three resistors. Check the coloured stripes – the two identical ones are 220 Ohms (red red brown) and the odd one out (with a blue stripe) is 4700 Ohms. The more Ohms, the more resistance to electricity. Resistors can be placed either way around.

Light-Emitting Diodes (LEDs)
Red and blue LEDs. The short leg is the negative leg. There is also a flat side to the rim of the bulb; this will also indicate which side is negative. LEDs also need a small resistor to prevent them from burning out. We will use a 220 Ohm resistor for each LED.

Jumper wires
Jumper wires. You should have six male-to-female jumpers (sticky-outy at one end, inny at the other end) and one male-to-male jumper (outy at both ends). Your wires may be of many different colours.

The circuit

Place the components on the breadboard like this.

The LEDs have their negative connector (short leg, flat side) to the right, on the same column as the 220 Ohm resistors.

The temperature sensor has three connectors:

The 4700 Ohm resistor crosses the columns between the temperature sensor's data connector (centre), and the positive connector (right).

Next, connect three male-to-female jumpers between the temperature sensor and the Raspberry Pi's GPIO pins.

 * 1) Ground (negative) goes to pin 6 (GND).
 * 2) Data (middle connector) goes to pin 7 (GPIO4).
 * 3) 3.3V (positive) goes to pin 1.

Note that pin numbers ("board numbers") and GPIO numbers ("BCM numbers" – Broadcom, the processor maker) are not the same.

Check the diagram.

Now connect the jumpers between the LEDs and the Raspberry Pi.

A male-to-female jumper goes from the positive leg of the blue LED to pin 16 (GPIO23).

Another male-to-female jumper goes from the positive leg of the red LED to pin 18 (GPIO24).

A male-to-male jumper crosses between the resistors in the bottom section, and finally, a male-to-female jumper goes from one of the resistors in the bottom section to pin 14 (GND).

Configuring the Pi for 1-Wire Sensors
The temperature sensor uses a 1-Wire interface (positive and negative connectors, plus 1 data connector). We need to turn 1-Wire on.

From the Raspberry Pi desktop, click Menu – Preferences – Raspberry Pi Configuration.

From the Configuration program, click the Interfaces tab at the top. Then find the 1-Wire row and click Enabled. If it's already enabled, that's fine. If it wasn't already enabled, you will be asked to reboot the machine – make sure you reboot.

First program – taking the temperature
From the menu, select Programming - Python 3. Then use File, New Window to create a new program and type it in. Alternatively, you can load the ready-made program using File, Open, then scroll sideways and double-click the python folder, then double-click the temperature folder, then click  and Open.

When typing in the program, make sure you put spaces where they're needed at the start of lines. For example, two spaces before. Spaces must line up.

Run the program by selecting Run menu, Run Module. You should see some temperature readings! Try warming up the sensor by holding it tightly. Stop the program by holding down the Ctrl key and pressing C.

teaches the computer about new things, using small programs that other people have written. We use the word "library" to decribe this. is a library that makes the GPIO pins easy to use. is a library that makes the temperature sensor easy to use. We also import the  command from the   library.

repeats a section forever (keep going while… always!)

reads the temperature from the sensor, and places the value in Celsius into the variable named. Variables are like boxes which can hold numbers or words.

outputs information to the screen. In this case, a temperature reading.

waits for a number of seconds. We leave a gap of 0.1 of a second between readings. However, readings also take a moment, so the loop doesn't go too fast.

Second program – lighting the LEDs
Change the program, or load in the  file:

Run the program by selecting Run menu, Run Module. The red and blue LEDs will change their brightness depending on the temperature! Stop the program with CTRL+C and try changing the values of cold and hot. Body temperature is about 37°C (98.6°F), an ice cube is 0°C (32°F) and a typical room temperature is 22 degrees Celsius (71.6 degrees Fahrenheit).

tells the computer that we have an LED connected, and that we will change the brightness using Pulse Width Modulation – flashing it on and off very quickly!

We set the brightness to a level (hotness) depending on the temperature between cold and hot.

If the temperature is hot or above, only red lights up (hotness is set to 1). If it's cold or below, only blue (hotness is set to 0). If it's in between, the brightness of blue and red will be dim or bright depending on temperature – that's the maths that does (temp-cold) divided by (hot-cold). Try working out the maths with a pencil or a calculator!

So hotness is always a decimal number between 0 (cold) and 1 (hot). We use a neat maths trick for the blue LED to get the "reverse" of the brightness; 1 minus hotness. When hotness is 0.8, the blue LED's brightness is: 1 − 0.8 = 0.2

Advanced programmers
Have a look at the  library to find out how we get the readings from the temperature sensor. Find the file  and output the readings from the terminal using the   command.

Alter the code for  library to use Fahrenheit rather than Celsius.

Cjam-temperature-tutorial.pdf
The original PDF for this tutorial is on Wikimedia Commons:


text:
Template:Non-breaking hyphen

{	"params": {}, "description": "Inserts a non-breaking hyphen (NBH), which keeps hyphenated words/phrases together preventing the parts from being on two different lines." }

title: Template:Non-breaking hyphen


text:
Template:Non-breaking hyphen/doc

Non-breaking hyphen produces a non-breaking hyphen (see w:en:WP:Non-breaking hyphen).

Character
The character used is

title: Template:Non-breaking hyphen/doc


text:
Fireboy and Watergirl in the Forest Temple/Level 5

Level 5 is one of the 5 levels which are unlocked after completing level 4. Completing level 5 will unlock level 6.


text:
User talk:119.75.204.218

Faster328

title: User talk:119.75.204.218


text:
Wikibooks:Reading room/Archives/2022/September

 Revised Enforcement Draft Guidelines for the Universal Code of Conduct

 * You can find this message translated into additional languages on Meta-wiki.
 *  metawiki:Special:MyLanguage/Universal Code of Conduct/Revised enforcement guidelines/Announcement •

Hello everyone,

The Universal Code of Conduct Enforcement Guidelines Revisions committee is requesting comments regarding the Revised Enforcement Draft Guidelines for the Universal Code of Conduct (UCoC). This review period will be open from 8 September 2022 until 8 October 2022.

The Committee collaborated to revise these draft guidelines based on input gathered from the community discussion period from May through July, as well as the community vote that concluded in March 2022. The revisions are focused on the following four areas:

 * 1) To identify the type, purpose, and applicability of the UCoC training;
 * 2) To simplify the language for more accessible translation and comprehension by non-experts;
 * 3) To explore the concept of affirmation, including its pros and cons;
 * 4) To review the balancing of the privacy of the accuser and the accused

The Committee requests comments and suggestions about these revisions by 8 October 2022. From there, the Revisions Committee anticipates further revising the guidelines based on community input.

Find the Revised Guidelines on Meta, and a comparison page in some languages.

Everyone may share comments in a number of places. Facilitators welcome comments in any language on the Revisions Guideline Talk Page. Comments can also be shared on talk pages of translations, at local discussions, or during conversation hours. There are planned live discussions about the UCoC enforcement draft guidelines; please see Meta times and details: Conversation hours

The facilitation team supporting this review period hopes to reach a large number of communities. If you do not see a conversation happening in your community, please organize a discussion. Facilitators can assist you in setting up the conversations. Discussions will be summarized and presented to the drafting committee every two weeks. The summaries will be published here.

On behalf of the T&S Policy Team

Mervat (WMF) (discuss • contribs) 11:10, 9 September 2022 (UTC)

The Vector 2022 skin as the default in two weeks?
Hello. I'm writing on behalf of the Wikimedia Foundation Web team. In two weeks, we would like to make the Vector 2022 skin the default on this wiki.

We have been working on it for the past three years. So far, it has been the default on more than 30 wikis, including sister projects, all accounting for more than 1 billion pageviews per month. On average 87% of active logged-in users of those wikis use Vector 2022.

It would become the default for all logged-out users, and also all logged-in users who currently use Vector legacy. Logged-in users can at any time switch to any other skins. No changes are expected for users of these skins.

About the skin
[Why is a change necessary] The current default skin meets the needs of the readers and editors as these were 13 years ago. Since then, new users have begun using Wikimedia projects. The old Vector doesn't meet their needs.

[Objective] The objective for the new skin is to make the interface more welcoming and comfortable for readers and useful for advanced users. It draws inspiration from previous requests, the Community Wishlist Surveys, and gadgets and scripts. The work helped our code follow the standards and improve all other skins. We reduced PHP code in Wikimedia deployed skins by 75%. The project has also focused on making it easier to support gadgets and use APIs.

[Changes and test results] The skin introduces a series of changes that improve readability and usability. The new skin does not remove any functionality currently available on the Vector skin.

 * The sticky header makes it easier to find tools that editors use often. It decreases scrolling to the top of the page by 16%.
 * The new table of contents makes it easier to navigate to different sections. Readers and editors jumped to different sections of the page 50% more than with the old table of contents. It also looks a bit different on talk pages.
 * The new search bar is easier to find and makes it easier to find the correct search result from the list. This increased the amount of searches started by 30% on the wikis we tested on.
 * The skin does not negatively affect pageviews, edit rates, or account creation. There is evidence of increases in pageviews and account creation across partner communities.

[Try it out] Try out the new skin by going to the appearance tab in your preferences and selecting Vector 2022 from the list of skins.

How can editors change and customize this skin?
It's possible to configure and personalize our changes. We support volunteers who create new gadgets and user scripts. Check out our repository for a list of currently available customizations, or add your own.

Our plan
If no large concerns are raised, we plan on deploying in the week of October 3, 2022. If your community would like to request more time to discuss the changes, hit the button and write to us. We can adjust the calendar.

Request for more time to discuss the change Also, if you'd like ask our team anything, if you have questions, concerns, or additional thoughts, please ping me here or write on the talk page of the project. We will also gladly answer! See our FAQ. Thank you! SGrabarczuk (WMF) (discuss • contribs) 03:20, 22 September 2022 (UTC)


text:
Wikijunior:Raspberry Pi/Raspberry Pi Build A Raspberry Pi Space Invaders Controller

Tutorial by Stuart Fox Thanks to Scott Bowman & Lee Robinson Public Domain 28th Jan 2017 – www.cotswoldjam.org

In this tutorial, we'll build a mini game controller, wire it to a Raspberry Pi's GPIO pins and write a program in Python to recognise the button presses. Finally we’ll examine and run a Space Invaders game, modified with the methods we’ve just learnt about to work with our controller.

What's in the kit?
In your bag you will find the following components:

 * ×6 M-F Jumper leads (pin to socket)
 * ×1 Mini Breadboard
 * ×3 Momentary Push Buttons

Part 1 – Let’s build the controller

Take a button by its connectors as shown and carefully bend the button so it is at a 90-degree angle to the pins.

Do this slowly and gently to avoid snapping the connectors.

Place the breadboard in front of you as in the image to the left. Use the numbers and letters shown in the image as a reference.

Now take your first button and push its connectors into holes E1 and E3 with the button facing away from you as shown on the right.

Repeat this process, placing your second button's connectors into holes E5 and E7 and the third button's connectors into holes E15 and E17.

Part 2 – Wiring your controller

The colour of the jumper wires in your kit is not important – where you put the jumper wires is important!

Make sure you connect to the correct holes and pins. Using the diagram above for reference, follow these steps to wire your controller:

Part 3 – The Code
Now you have a controller built and wired to your Raspberry Pi's GPIO Pins, it’s time to see if it works. Make sure your wires have been checked by a tutor before you power up your Pi.

Power up your Raspberry Pi. From the desktop menu, select Programming – Thonny Python IDE.

Let’s run the program. Use the Run button on the top of the window.

Now try pushing each of your buttons. If everything is working the program will show the text correponding to each button when it's pressed.

Type in the following code
Now use File, Save As to save your program as the name of your choice (don’t forget to put .py on the end) in the  folder.

This program shows us how to use the GPIOZero library to trigger functions in Python and will also serve to test your newly built controller.

Let's look at how this program works…
The  lines tell the computer to learn about new things. Computers can learn from programs that other people have written; we call these other programs "libraries". Our program needs the function called button from the  library which it will use to detect button presses on your controller. The function  from the   library so that we can insert pauses.

These lines set the names of our buttons and tell the program which GPIO pin they are connected to. So now the program will see our three buttons connected to these three GPIO pins: pin 5 (I2C1 SCL), pin 6 (GND) and pin 7 (GPIO 4)

Here we are setting up functions called,   and. Functions contain multiple instructions, ready to be triggered by an event or input. In this case, each function only performs one task, and that is to print some text on the screen. When we look at the Space Invaders game code, we will see functions like this performing multiple tasks at once when triggered.

This  tells the program to run forever in a loop.

Now we are telling the program to trigger a function when a button is pressed.

Part 4 – Let's Play Space Invaders

Now our control panel is built and tested, it's time to defend earth against an alien attack! In Thonny Python IDE, Use File, Open to open  program in the   folder.

Now enable line numbers: from the Tools menu select options, choose the editor tab, then tick the box by 'Show Line Numbers'.

Look at the following lines of code and see if you recognise the way this game has been modified to work with our controller.

Lines 12 to 20, lines 55 to 63, and lines 451 to 484. These lines are commented to explain the modifications.

Now, click the Run button and our modified Space Invaders game will launch.

 * Button one is left
 * Button two is right
 * Button three is fire

You can press fire or the space bar to start the game.

Files
The assets for this Space Invaders game are in the Raspberry Pi tutorials Button Invaders assets category on Wikicommons.

Space Invaders Controler Tutorial2.pdf
The original PDF for this tutorial is available on Wikimedia Commons:

LICENSE.txt
Note: The source code is available under the permissive MIT License as per the GitHub repository: https://github.com/leerob/space-invaders/blob/master/LICENSE


text:
Wikijunior:Raspberry Pi/Introduction to Scratch

Scratch is a visual programming language developed by the Massachusetts Institute of Technology (MIT) to introduce programming concepts to children.

Installing Scratch
Scratch is preinstalled on Raspberry Pi OS (and its predecessor Raspbian) by default.

Online Scratch 3 editor
There is an online editor on the website that can be used for the tutorials which should work on most modern web browsers such as Google Chrome (and its open-source counterpart Chromium), Microsoft Edge, Apple Safari, Opera and Mozilla Firefox.

Offline Scratch 3 editor
Alternatively, you can also download a copy of the offline editor from the official website. Scratch 3 officially supports these operating systems:

 * Windows logo - 2021.svg Microsoft Windows 10 and Windows 11 via the Microsoft Store or direct download
 * Apple logo dark grey.svg Apple macOS 10.13 (High Sierra) and later via the Mac App Store or direct download
 * Google Chrome icon (February 2022).svg Google ChromeOS via the Google Play store
 * Android Robot Head 2023.svg Google Android 6 (Marshmallow) and later via the Google Play store

You can also install Scratch 3 on Windows 10 and Windows 11 via the Winget command in Windows PowerShell:

Alternative Linux distributions
If you use an alternative Linux distribution to Raspberry Pi OS, you may need to install Scratch using the package manager via the Terminal:

 * Ardebian logo.svg Debian and Ubuntu-logo-no-wordmark-solid-o-2022.svg Ubuntu:
 * Fedora logo.svg Fedora:
 * Arch Linux "Crystal" icon.svg Arch:

A simple "Hello World" program
Creating a "Hello World" program in Scratch 3 is very simple:

 * 1) From the Events category, select and drag the yellow "when Greenflag.svg clicked" block.
 * 2) From the Looks category, select and drag the purple "say 'Hello!'" block.
 * 3) Change the text in the purple block from "Hello!" to "Hello World".
 * 4) Click the Go button (with the green flag icon Greenflag.svg) to start the program.

This is equivalent to writing  in the Python programming language.

Moving a sprite
Moving a sprite is essential for making games and other animations. To move a sprite in Scratch, follow these steps:

 * 1) Add a sprite to your project.
 * 2) From the Events category, select and drag the yellow "when Greenflag.svg clicked" block.
 * 3) From the Motion category, select and drag the "move 10 steps" block.
 * 4) Click the Go button (with the green flag icon Greenflag.svg) to start the program.
 * 5) Watch as your sprite moves 10 steps to the right.

You can change the number in the "move 10 steps" block to make your sprite move faster or slower. You can also drag other motion blocks, such as "turn 10 degrees" and "go to x: 100 y: 100", to make your sprite move in different ways.

Making a sprite jump
This is a more advanced Scratch concept, but it's still relatively easy to learn. To make a sprite jump in Scratch, follow these steps:

 * 1) Add a sprite to your project.
 * 2) From the Control category, drag a "when Greenflag.svg clicked" block category to the Scripting Area.
 * 3) From the Control category, drag a "wait 1 second" block to the Scripting Area and place it inside the "when green flag clicked" block.
 * 4) From the Motion category, drag a "change y by 10" block to the Scripting Area and place it inside the "wait 1 second" block.
 * 5) From the Motion category, drag a "change y by -10" block to the Scripting Area and place it below the "wait 1 second" block.
 * 6) Click the Go button (with the green flag icon Greenflag.svg) to start the program.
 * 7) Watch as your sprite jumps into the air and then falls back down.

You can change the number in the "change y by 10" and "change y by -10" blocks to make your sprite jump higher or lower. You can also add more "wait 1 second" blocks to make your sprite stay in the air for longer.


text:
Wikijunior:Raspberry Pi/Authors

List of contributors in alphabetical surname order:

 * Andy Baker
 * Mark Cantrill
 * Stuart Fox
 * Martin O'Hanlon
 * Hal Motley
 * Andy Oakley
 * David Pride
 * Laura Sach

title: Wikijunior:Raspberry Pi/Authors


text:
JavaScript/Variables

Purpose
Computer languages need to use variables. Why this? In most cases, programs don't solve single problems like the very concrete question: What is the circumference of a circle with a radius of 5 cm? Such a concrete question can be solved without using variables:  Instead, most questions are more general: What is the circumference of a circle with an arbitrary radius? You don't want to write a program for a radius of 5 cm, another program for a radius of 6 cm, another one for a radius of 7 cm, and so on. You want to write a single program that computes the circumference for all possible radii. The program needs input (from a user, from another program, from a database, ...) that tells him for which value it shall run. , or even better:.

Those two examples are flexible. They ask the user for the desired radius, store the given value in a variable with the name r, and compute the circumference using this variable. The variable r is introduced by the keyword. And there is a second variable. The module Math has predefined a variable PI with the keyword :.

In JavaScript, variables can be used similarly to variables in mathematical formulas. During runtime, the values of variables are stored in the main memory of the computer (RAM), from where they can be used at a later moment in the lifetime of the program. You can imagine a variable as a small box where you deposit some value and take it out whenever you need it.

Variables are a cornerstone in the transition from individual problem solving to a strategy, respectively an algorithm.

Declaration and initialization
If you want to use a variable, we recommend declaring them explicitly. This is not mandatory but has strong benefits.

In many cases, the declaration is accompanied by an initialization, e.g. . The declaration is , and the initialization is. But it's also possible to omit the initialization part:  which causes the value of the variable to be.

Keyword
The keyword  introduces a variable whose value may be changed multiple times.

Keyword
The keyword  introduces a variable that must be initialized immediately. Moreover, this very first value can never be changed. That helps the JavaScript engine to optimize the code for better performance. Use  as often as possible.

When you work with objects, e.g., with arrays, in combination with the keyword, it's the same: you cannot assign another value (object, array, number, or whatever) to the variable. Nevertheless, its elements can be changed.

In some cases  variables are written in uppercase, e.g.,. This is a convention and not mandatory.

Keyword
At first glance,  is identical to. But the range where such variables are known is different from the variables declared by ; see chapter Scope below.

Omitting the declaration
You can assign a value to a variable without declaring the variable previously. "JavaScript used to allow assigning to undeclared variables, which creates an undeclared global variable. This is an error in strict mode and should be avoided altogether." In other words: The variable goes to global scope, see below. As long as you don't have good reasons you should avoid using the global scope because its usage tends to create unwanted side effects.

Sometimes such situations occur by accident. If there is a typing error in the source code, JavaScript uses two different variables: the original one and a new one with the wrongly typed name - even if you use one of the keywords,  , or.

You can instruct JavaScript to search for such typos by inserting the command  as the first line of your scripts.

Data types
Programmers who are familiar with (strict) typed languages like Java may miss in the above chapter the possibility of defining the type of variables. JavaScript knows many different data types. But their handling and behavior is very different from that in Java. In the next chapter you will learn about that.

Scope
A scope is a range of consecutive JavaScript statements with a clearly defined start and end. JavaScript knows four types of scopes: block, function, module, and global scope. Depending on the kind of declaration and the location of the declaration, variables are within such scopes. They are 'visible' respectively 'accessible' only within their scope. If you try to access them from outside, an error will occur.

Block scope
A pair of curly brackets  creates a block. Variables declared within a block by  or   are bound to this block and cannot be accessed outside.

The variable  is declared inside a block (in this simple example, the block consists of only two lines.) It is not accessible behind the end of the block, which is the closing curly bracket   in the   line. The same applies to the case that the variable  is declared with   instead of.

Be careful with the keyword ; its semantics is different! First,  is not block-scoped. Second, it leads to a technique called hoisting, which has been used in JavaScript since its first days. Hoisting changes the semantics of different declarations 'under the hood'. Concerning, it splits declaration and initialization into two separate statements and shifts the declaration part to the top of the current scope. Hence the variable is declared but not initialized if you use it before the line where it is declared in the source.

The script

is changed to:

On the other hand, the keyword  keeps the declaration in the line where it is written.

There are more differences. Here is a version of the first example of this chapter replacing  by  :

We recommend avoiding  completely because of two reasons: Instead of using, use the keyword.
 * JavaScript's hoisting technique is not easy to understand.
 * Other members of the C-family languages don't know it.

Function scope
A function creates its own scope. Variables declared in the function's scope cannot be accessed from outside.

The function scope is sometimes called the local scope because this was the name in older ECMAScript versions.

See also: Closures works the other way round - access of outer variables inside the function.

Module scope
It is possible to divide huge scripts into multiple files and let the functions and variables communicate with each other. Each file creates its own scope, the module scope. The chapter JavaScript/Modules explains more about that.

Global scope
Variables or functions are in global scope if they are declared at the top level of a script (outside of all blocks and functions).

is declared at the top level, hence it is in the global scope and can be used everywhere. But in the next example the declaration of  is wrapped by. Hence it is no longer in global scope.

Hint: The use of the global scope isn't considered good practice. It tends to create unwanted side effects. Instead, try to modularize your code and let the parts communicate via interfaces.

Exercises

 * ... are available on another page (click here).

title: JavaScript/Variables


text:
JavaScript/Data types

Introduction
Each variable in JavaScript has a certain data type (Number, String, Boolean, ...) - as long as a value is stored in the variable. The type of the value determines the type of the variable. In contrast to strongly typed languages, it is possible to assign - over time - values of different types to the variable so that the type of the variable may change. This is called weakly or loosely typing. The advantage is that JavaScript programmers have a wealth of possibilities and freedom to use (or abuse) variables. On the other hand, in strongly typed languages, a lot of formal errors can be detected during compile-time.

JavaScript knows seven primitive data types (Number, String, Boolean, BigInt, Symbol, Undefined, Null) and diverse other data types, which are all derived from Object (Array, Date, Error, Function, RegExp). Objects contain not only a value, they also have methods and properties. The same can happen with primitive data types. If they try to invoke methods, the JS engine 'wraps' them with a corresponding object wrapper and calls its methods instead. This technique is sometimes called boxing.

You may wonder why we describe data types and initialization in the same chapter. The reason is that they are very closely related to each other. The initialization (and subsequent assignments) of a value to a variable determines its type - as noted above. That's why there is no designation of a type during initialization, in contrast to some other languages

(Note: JSON is a text-based data format, not a data type. As such, it’s language-independent. It uses the JavaScript object syntax.)

Categories of data types
Data types are explained in the following chapters.
 * Primitive data type
 * Objects
 * Arrays
 * Dates
 * Regular Expressions

title: JavaScript/Data types