19 skills found
chrisneagu / FTC Skystone Dark Angels Romania 2020NOTICE This repository contains the public FTC SDK for the SKYSTONE (2019-2020) competition season. If you are looking for the current season's FTC SDK software, please visit the new and permanent home of the public FTC SDK: FtcRobotController repository Welcome! This GitHub repository contains the source code that is used to build an Android app to control a FIRST Tech Challenge competition robot. To use this SDK, download/clone the entire project to your local computer. Getting Started If you are new to robotics or new to the FIRST Tech Challenge, then you should consider reviewing the FTC Blocks Tutorial to get familiar with how to use the control system: FTC Blocks Online Tutorial Even if you are an advanced Java programmer, it is helpful to start with the FTC Blocks tutorial, and then migrate to the OnBot Java Tool or to Android Studio afterwards. Downloading the Project If you are an Android Studio programmer, there are several ways to download this repo. Note that if you use the Blocks or OnBot Java Tool to program your robot, then you do not need to download this repository. If you are a git user, you can clone the most current version of the repository: git clone https://github.com/FIRST-Tech-Challenge/SKYSTONE.git Or, if you prefer, you can use the "Download Zip" button available through the main repository page. Downloading the project as a .ZIP file will keep the size of the download manageable. You can also download the project folder (as a .zip or .tar.gz archive file) from the Downloads subsection of the Releases page for this repository. Once you have downloaded and uncompressed (if needed) your folder, you can use Android Studio to import the folder ("Import project (Eclipse ADT, Gradle, etc.)"). Getting Help User Documentation and Tutorials FIRST maintains online documentation with information and tutorials on how to use the FIRST Tech Challenge software and robot control system. You can access this documentation using the following link: SKYSTONE Online Documentation Note that the online documentation is an "evergreen" document that is constantly being updated and edited. It contains the most current information about the FIRST Tech Challenge software and control system. Javadoc Reference Material The Javadoc reference documentation for the FTC SDK is now available online. Click on the following link to view the FTC SDK Javadoc documentation as a live website: FTC Javadoc Documentation Documentation for the FTC SDK is also included with this repository. There is a subfolder called "doc" which contains several subfolders: The folder "apk" contains the .apk files for the FTC Driver Station and FTC Robot Controller apps. The folder "javadoc" contains the JavaDoc user documentation for the FTC SDK. Online User Forum For technical questions regarding the Control System or the FTC SDK, please visit the FTC Technology forum: FTC Technology Forum Release Information Version 5.5 (20200824-090813) Version 5.5 requires Android Studio 4.0 or later. New features Adds support for calling custom Java classes from Blocks OpModes (fixes SkyStone issue #161). Classes must be in the org.firstinspires.ftc.teamcode package. Methods must be public static and have no more than 21 parameters. Parameters declared as OpMode, LinearOpMode, Telemetry, and HardwareMap are supported and the argument is provided automatically, regardless of the order of the parameters. On the block, the sockets for those parameters are automatically filled in. Parameters declared as char or java.lang.Character will accept any block that returns text and will only use the first character in the text. Parameters declared as boolean or java.lang.Boolean will accept any block that returns boolean. Parameters declared as byte, java.lang.Byte, short, java.lang.Short, int, java.lang.Integer, long, or java.lang.Long, will accept any block that returns a number and will round that value to the nearest whole number. Parameters declared as float, java.lang.Float, double, java.lang.Double will accept any block that returns a number. Adds telemetry API method for setting display format Classic Monospace HTML (certain tags only) Adds blocks support for switching cameras. Adds Blocks support for TensorFlow Object Detection with a custom model. Adds support for uploading a custom TensorFlow Object Detection model in the Manage page, which is especially useful for Blocks and OnBotJava users. Shows new Control Hub blink codes when the WiFi band is switched using the Control Hub's button (only possible on Control Hub OS 1.1.2) Adds new warnings which can be disabled in the Advanced RC Settings Mismatched app versions warning Unnecessary 2.4 GHz WiFi usage warning REV Hub is running outdated firmware (older than version 1.8.2) Adds support for Sony PS4 gamepad, and reworks how gamepads work on the Driver Station Removes preference which sets gamepad type based on driver position. Replaced with menu which allows specifying type for gamepads with unknown VID and PID Attempts to auto-detect gamepad type based on USB VID and PID If gamepad VID and PID is not known, use type specified by user for that VID and PID If gamepad VID and PID is not known AND the user has not specified a type for that VID and PID, an educated guess is made about how to map the gamepad Driver Station will now attempt to automatically recover from a gamepad disconnecting, and re-assign it to the position it was assigned to when it dropped If only one gamepad is assigned and it drops: it can be recovered If two gamepads are assigned, and have different VID/PID signatures, and only one drops: it will be recovered If two gamepads are assigned, and have different VID/PID signatures, and BOTH drop: both will be recovered If two gamepads are assigned, and have the same VID/PID signatures, and only one drops: it will be recovered If two gamepads are assigned, and have the same VID/PID signatures, and BOTH drop: neither will be recovered, because of the ambiguity of the gamepads when they re-appear on the USB bus. There is currently one known edge case: if there are two gamepads with the same VID/PID signature plugged in, but only one is assigned, and they BOTH drop, it's a 50-50 chance of which one will be chosen for automatic recovery to the assigned position: it is determined by whichever one is re-enumerated first by the USB bus controller. Adds landscape user interface to Driver Station New feature: practice timer with audio cues New feature (Control Hub only): wireless network connection strength indicator (0-5 bars) New feature (Control Hub only): tapping on the ping/channel display will switch to an alternate display showing radio RX dBm and link speed (tap again to switch back) The layout will NOT autorotate. You can switch the layout from the Driver Station's settings menu. Breaking changes Removes support for Android versions 4.4 through 5.1 (KitKat and Lollipop). The minSdkVersion is now 23. Removes the deprecated LinearOpMode methods waitOneFullHardwareCycle() and waitForNextHardwareCycle() Enhancements Handles RS485 address of Control Hub automatically The Control Hub is automatically given a reserved address Existing configuration files will continue to work All addresses in the range of 1-10 are still available for Expansion Hubs The Control Hub light will now normally be solid green, without blinking to indicate the address The Control Hub will not be shown on the Expansion Hub Address Change settings page Improves REV Hub firmware updater The user can now choose between all available firmware update files Version 1.8.2 of the REV Hub firmware is bundled into the Robot Controller app. Text was added to clarify that Expansion Hubs can only be updated via USB. Firmware update speed was reduced to improve reliability Allows REV Hub firmware to be updated directly from the Manage webpage Improves log viewer on Robot Controller Horizontal scrolling support (no longer word wrapped) Supports pinch-to-zoom Uses a monospaced font Error messages are highlighted New color scheme Attempts to force-stop a runaway/stuck OpMode without restarting the entire app Not all types of runaway conditions are stoppable, but if the user code attempts to talk to hardware during the runaway, the system should be able to capture it. Makes various tweaks to the Self Inspect screen Renames "OS version" entry to "Android version" Renames "WiFi Direct Name" to "WiFi Name" Adds Control Hub OS version, when viewing the report of a Control Hub Hides the airplane mode entry, when viewing the report of a Control Hub Removes check for ZTE Speed Channel Changer Shows firmware version for all Expansion and Control Hubs Reworks network settings portion of Manage page All network settings are now applied with a single click The WiFi Direct channel of phone-based Robot Controllers can now be changed from the Manage page WiFi channels are filtered by band (2.4 vs 5 GHz) and whether they overlap with other channels The current WiFi channel is pre-selected on phone-based Robot Controllers, and Control Hubs running OS 1.1.2 or later. On Control Hubs running OS 1.1.2 or later, you can choose to have the system automatically select a channel on the 5 GHz band Improves OnBotJava New light and dark themes replace the old themes (chaos, github, chrome,...) the new default theme is light and will be used when you first update to this version OnBotJava now has a tabbed editor Read-only offline mode Improves function of "exit" menu item on Robot Controller and Driver Station Now guaranteed to be fully stopped and unloaded from memory Shows a warning message if a LinearOpMode exists prematurely due to failure to monitor for the start condition Improves error message shown when the Driver Station and Robot Controller are incompatible with each other Driver Station OpMode Control Panel now disabled while a Restart Robot is in progress Disables advanced settings related to WiFi direct when the Robot Controller is a Control Hub. Tint phone battery icons on Driver Station when low/critical. Uses names "Control Hub Portal" and "Control Hub" (when appropriate) in new configuration files Improve I2C read performance Very large improvement on Control Hub; up to ~2x faster with small (e.g. 6 byte) reads Not as apparent on Expansion Hubs connected to a phone Update/refresh build infrastructure Update to 'androidx' support library from 'com.android.support:appcompat', which is end-of-life Update targetSdkVersion and compileSdkVersion to 28 Update Android Studio's Android plugin to latest Fix reported build timestamp in 'About' screen Add sample illustrating manual webcam use: ConceptWebcam Bug fixes Fixes SkyStone issue #248 Fixes SkyStone issue #232 and modifies bulk caching semantics to allow for cache-preserving MANUAL/AUTO transitions. Improves performance when REV 2M distance sensor is unplugged Improves readability of Toast messages on certain devices Allows a Driver Station to connect to a Robot Controller after another has disconnected Improves generation of fake serial numbers for UVC cameras which do not provide a real serial number Previously some devices would assign such cameras a serial of 0:0 and fail to open and start streaming Fixes ftc_app issue #638. Fixes a slew of bugs with the Vuforia camera monitor including: Fixes bug where preview could be displayed with a wonky aspect ratio Fixes bug where preview could be cut off in landscape Fixes bug where preview got totally messed up when rotating phone Fixes bug where crosshair could drift off target when using webcams Fixes issue in UVC driver on some devices (ftc_app 681) if streaming was started/stopped multiple times in a row Issue manifested as kernel panic on devices which do not have this kernel patch. On affected devices which do have the patch, the issue was manifest as simply a failure to start streaming. The Tech Team believes that the root cause of the issue is a bug in the Linux kernel XHCI driver. A workaround was implemented in the SDK UVC driver. Fixes bug in UVC driver where often half the frames from the camera would be dropped (e.g. only 15FPS delivered during a streaming session configured for 30FPS). Fixes issue where TensorFlow Object Detection would show results whose confidence was lower than the minimum confidence parameter. Fixes a potential exploitation issue of CVE-2019-11358 in OnBotJava Fixes changing the address of an Expansion Hub with additional Expansion Hubs connected to it Preserves the Control Hub's network connection when "Restart Robot" is selected Fixes issue where device scans would fail while the Robot was restarting Fix RenderScript usage Use androidx.renderscript variant: increased compatibility Use RenderScript in Java mode, not native: simplifies build Fixes webcam-frame-to-bitmap conversion problem: alpha channel wasn't being initialized, only R, G, & B Fixes possible arithmetic overflow in Deadline Fixes deadlock in Vuforia webcam support which could cause 5-second delays when stopping OpMode Version 5.4 (20200108-101156) Fixes SkyStone issue #88 Adds an inspection item that notes when a robot controller (Control Hub) is using the factory default password. Fixes SkyStone issue #61 Fixes SkyStone issue #142 Fixes ftc_app issue #417 by adding more current and voltage monitoring capabilities for REV Hubs. Fixes a crash sometimes caused by OnBotJava activity Improves OnBotJava autosave functionality ftc_app #738 Fixes system responsiveness issue when an Expansion Hub is disconnected Fixes issue where IMU initialization could prevent Op Modes from stopping Fixes issue where AndroidTextToSpeech.speak() would fail if it was called too early Adds telemetry.speak() methods and blocks, which cause the Driver Station (if also updated) to speak text Adds and improves Expansion Hub-related warnings Improves Expansion Hub low battery warning Displays the warning immediately after the hub reports it Specifies whether the condition is current or occurred temporarily during an OpMode run Displays which hubs reported low battery Displays warning when hub loses and regains power during an OpMode run Fixes the hub's LED pattern after this condition Displays warning when Expansion Hub is not responding to commands Specifies whether the condition is current or occurred temporarily during an OpMode run Clarifies warning when Expansion Hub is not present at startup Specifies that this condition requires a Robot Restart before the hub can be used. The hub light will now accurately reflect this state Improves logging and reduces log spam during these conditions Syncs the Control Hub time and timezone to a connected web browser programming the robot, if a Driver Station is not available. Adds bulk read functionality for REV Hubs A bulk caching mode must be set at the Hub level with LynxModule#setBulkCachingMode(). This applies to all relevant SDK hardware classes that reference that Hub. The following following Hub bulk caching modes are available: BulkCachingMode.OFF (default): All hardware calls operate as usual. Bulk data can read through LynxModule#getBulkData() and processed manually. BulkCachingMode.AUTO: Applicable hardware calls are served from a bulk read cache that is cleared/refreshed automatically to ensure identical commands don't hit the same cache. The cache can also be cleared manually with LynxModule#clearBulkCache(), although this is not recommended. (advanced users) BulkCachingMode.MANUAL: Same as BulkCachingMode.AUTO except the cache is never cleared automatically. To avoid getting stale data, the cache must be manually cleared at the beginning of each loop body or as the user deems appropriate. Removes PIDF Annotation values added in Rev 5.3 (to AndyMark, goBILDA and TETRIX motor configurations). The new motor types will still be available but their Default control behavior will revert back to Rev 5.2 Adds new ConceptMotorBulkRead sample Opmode to demonstrate and compare Motor Bulk-Read modes for reducing I/O latencies. Version 5.3 (20191004-112306) Fixes external USB/UVC webcam support Makes various bugfixes and improvements to Blocks page, including but not limited to: Many visual tweaks Browser zoom and window resize behave better Resizing the Java preview pane works better and more consistently across browsers The Java preview pane consistently gets scrollbars when needed The Java preview pane is hidden by default on phones Internet Explorer 11 should work Large dropdown lists display properly on lower res screens Disabled buttons are now visually identifiable as disabled A warning is shown if a user selects a TFOD sample, but their device is not compatible Warning messages in a Blocks op mode are now visible by default. Adds goBILDA 5201 and 5202 motors to Robot Configurator Adds PIDF Annotation values to AndyMark, goBILDA and TETRIX motor configurations. This has the effect of causing the RUN_USING_ENCODERS and RUN_TO_POSITION modes to use PIDF vs PID closed loop control on these motors. This should provide more responsive, yet stable, speed control. PIDF adds Feedforward control to the basic PID control loop. Feedforward is useful when controlling a motor's speed because it "anticipates" how much the control voltage must change to achieve a new speed set-point, rather than requiring the integrated error to change sufficiently. The PIDF values were chosen to provide responsive, yet stable, speed control on a lightly loaded motor. The more heavily a motor is loaded (drag or friction), the more noticable the PIDF improvement will be. Fixes startup crash on Android 10 Fixes ftc_app issue #712 (thanks to FROGbots-4634) Fixes ftc_app issue #542 Allows "A" and lowercase letters when naming device through RC and DS apps. Version 5.2 (20190905-083277) Fixes extra-wide margins on settings activities, and placement of the new configuration button Adds Skystone Vuforia image target data. Includes sample Skystone Vuforia Navigation op modes (Java). Includes sample Skystone Vuforia Navigation op modes (Blocks). Adds TensorFlow inference model (.tflite) for Skystone game elements. Includes sample Skystone TensorFlow op modes (Java). Includes sample Skystone TensorFlow op modes (Blocks). Removes older (season-specific) sample op modes. Includes 64-bit support (to comply with Google Play requirements). Protects against Stuck OpModes when a Restart Robot is requested. (Thanks to FROGbots-4634) (ftc_app issue #709) Blocks related changes: Fixes bug with blocks generated code when hardware device name is a java or javascript reserved word. Shows generated java code for blocks, even when hardware items are missing from the active configuration. Displays warning icon when outdated Vuforia and TensorFlow blocks are used (SkyStone issue #27) Version 5.1 (20190820-222104) Defines default PIDF parameters for the following motors: REV Core Hex Motor REV 20:1 HD Hex Motor REV 40:1 HD Hex Motor Adds back button when running on a device without a system back button (such as a Control Hub) Allows a REV Control Hub to update the firmware on a REV Expansion Hub via USB Fixes SkyStone issue #9 Fixes ftc_app issue #715 Prevents extra DS User clicks by filtering based on current state. Prevents incorrect DS UI state changes when receiving new OpMode list from RC Adds support for REV Color Sensor V3 Adds a manual-refresh DS Camera Stream for remotely viewing RC camera frames. To show the stream on the DS, initialize but do not run a stream-enabled opmode, select the Camera Stream option in the DS menu, and tap the image to refresh. This feature is automatically enabled when using Vuforia or TFOD—no additional RC configuration is required for typical use cases. To hide the stream, select the same menu item again. Note that gamepads are disabled and the selected opmode cannot be started while the stream is open as a safety precaution. To use custom streams, consult the API docs for CameraStreamServer#setSource and CameraStreamSource. Adds many Star Wars sounds to RobotController resources. Added SKYSTONE Sounds Chooser Sample Program. Switches out startup, connect chimes, and error/warning sounds for Star Wars sounds Updates OnBot Java to use a WebSocket for communication with the robot The OnBot Java page no longer has to do a full refresh when a user switches from editing one file to another Known issues: Camera Stream The Vuforia camera stream inherits the issues present in the phone preview (namely ftc_app issue #574). This problem does not affect the TFOD camera stream even though it receives frames from Vuforia. The orientation of the stream frames may not always match the phone preview. For now, these frames may be rotated manually via a custom CameraStreamSource if desired. OnBotJava Browser back button may not always work correctly It's possible for a build to be queued, but not started. The OnBot Java build console will display a warning if this occurs. A user might not realize they are editing a different file if the user inadvertently switches from one file to another since this switch is now seamless. The name of the currently open file is displayed in the browser tab. Version 5.0 (built on 19.06.14) Support for the REV Robotics Control Hub. Adds a Java preview pane to the Blocks editor. Adds a new offline export feature to the Blocks editor. Display wifi channel in Network circle on Driver Station. Adds calibration for Logitech C270 Updates build tooling and target SDK. Compliance with Google's permissions infrastructure (Required after build tooling update). Keep Alives to mitigate the Motorola wifi scanning problem. Telemetry substitute no longer necessary. Improves Vuforia error reporting. Fixes ftctechnh/ftc_app issues 621, 713. Miscellaneous bug fixes and improvements. Version 4.3 (built on 18.10.31) Includes missing TensorFlow-related libraries and files. Version 4.2 (built on 18.10.30) Includes fix to avoid deadlock situation with WatchdogMonitor which could result in USB communication errors. Comm error appeared to require that user disconnect USB cable and restart the Robot Controller app to recover. robotControllerLog.txt would have error messages that included the words "E RobotCore: lynx xmit lock: #### abandoning lock:" Includes fix to correctly list the parent module address for a REV Robotics Expansion Hub in a configuration (.xml) file. Bug in versions 4.0 and 4.1 would incorrect list the address module for a parent REV Robotics device as "1". If the parent module had a higher address value than the daisy-chained module, then this bug would prevent the Robot Controller from communicating with the downstream Expansion Hub. Added requirement for ACCESS_COARSE_LOCATION to allow a Driver Station running Android Oreo to scan for Wi-Fi Direct devices. Added google() repo to build.gradle because aapt2 must be downloaded from the google() repository beginning with version 3.2 of the Android Gradle Plugin. Important Note: Android Studio users will need to be connected to the Internet the first time build the ftc_app project. Internet connectivity is required for the first build so the appropriate files can be downloaded from the Google repository. Users should not need to be connected to the Internet for subsequent builds. This should also fix buid issue where Android Studio would complain that it "Could not find com.android.tools.lint:lint-gradle:26.1.4" (or similar). Added support for REV Spark Mini motor controller as part of the configuration menu for a servo/PWM port on the REV Expansion Hub. Provide examples for playing audio files in an Op Mode. Block Development Tool Changes Includes a fix for a problem with the Velocity blocks that were reported in the FTC Technology forum (Blocks Programming subforum). Change the "Save completed successfully." message to a white color so it will contrast with a green background. Fixed the "Download image" feature so it will work if there are text blocks in the op mode. Introduce support for Google's TensorFlow Lite technology for object detetion for 2018-2019 game. TensorFlow lite can recognize Gold Mineral and Silver Mineral from 2018-2019 game. Example Java and Block op modes are included to show how to determine the relative position of the gold block (left, center, right). Version 4.1 (released on 18.09.24) Changes include: Fix to prevent crash when deprecated configuration annotations are used. Change to allow FTC Robot Controller APK to be auto-updated using FIRST Global Control Hub update scripts. Removed samples for non supported / non legal hardware. Improvements to Telemetry.addData block with "text" socket. Updated Blocks sample op mode list to include Rover Ruckus Vuforia example. Update SDK library version number. Version 4.0 (released on 18.09.12) Changes include: Initial support for UVC compatible cameras If UVC camera has a unique serial number, RC will detect and enumerate by serial number. If UVC camera lacks a unique serial number, RC will only support one camera of that type connected. Calibration settings for a few cameras are included (see TeamCode/src/main/res/xml/teamwebcamcalibrations.xml for details). User can upload calibration files from Program and Manage web interface. UVC cameras seem to draw a fair amount of electrical current from the USB bus. This does not appear to present any problems for the REV Robotics Control Hub. This does seem to create stability problems when using some cameras with an Android phone-based Robot Controller. FTC Tech Team is investigating options to mitigate this issue with the phone-based Robot Controllers. Updated sample Vuforia Navigation and VuMark Op Modes to demonstrate how to use an internal phone-based camera and an external UVC webcam. Support for improved motor control. REV Robotics Expansion Hub firmware 1.8 and greater will support a feed forward mechanism for closed loop motor control. FTC SDK has been modified to support PIDF coefficients (proportional, integral, derivative, and feed forward). FTC Blocks development tool modified to include PIDF programming blocks. Deprecated older PID-related methods and variables. REV's 1.8.x PIDF-related changes provide a more linear and accurate way to control a motor. Wireless Added 5GHz support for wireless channel changing for those devices that support it. Tested with Moto G5 and E4 phones. Also tested with other (currently non-approved) phones such as Samsung Galaxy S8. Improved Expansion Hub firmware update support in Robot Controller app Changes to make the system more robust during the firmware update process (when performed through Robot Controller app). User no longer has to disconnect a downstream daisy-chained Expansion Hub when updating an Expansion Hub's firmware. If user is updating an Expansion Hub's firmware through a USB connection, he/she does not have to disconnect RS485 connection to other Expansion Hubs. The user still must use a USB connection to update an Expansion Hub's firmware. The user cannot update the Expansion Hub firmware for a downstream device that is daisy chained through an RS485 connection. If an Expansion Hub accidentally gets "bricked" the Robot Controller app is now more likely to recognize the Hub when it scans the USB bus. Robot Controller app should be able to detect an Expansion Hub, even if it accidentally was bricked in a previous update attempt. Robot Controller app should be able to install the firmware onto the Hub, even if if accidentally was bricked in a previous update attempt. Resiliency FTC software can detect and enable an FTDI reset feature that is available with REV Robotics v1.8 Expansion Hub firmware and greater. When enabled, the Expansion Hub can detect if it hasn't communicated with the Robot Controller over the FTDI (USB) connection. If the Hub hasn't heard from the Robot Controller in a while, it will reset the FTDI connection. This action helps system recover from some ESD-induced disruptions. Various fixes to improve reliability of FTC software. Blocks Fixed errors with string and list indices in blocks export to java. Support for USB connected UVC webcams. Refactored optimized Blocks Vuforia code to support Rover Ruckus image targets. Added programming blocks to support PIDF (proportional, integral, derivative and feed forward) motor control. Added formatting options (under Telemetry and Miscellaneous categories) so user can set how many decimal places to display a numerical value. Support to play audio files (which are uploaded through Blocks web interface) on Driver Station in addition to the Robot Controller. Fixed bug with Download Image of Blocks feature. Support for REV Robotics Blinkin LED Controller. Support for REV Robotics 2m Distance Sensor. Added support for a REV Touch Sensor (no longer have to configure as a generic digital device). Added blocks for DcMotorEx methods. These are enhanced methods that you can use when supported by the motor controller hardware. The REV Robotics Expansion Hub supports these enhanced methods. Enhanced methods include methods to get/set motor velocity (in encoder pulses per second), get/set PIDF coefficients, etc.. Modest Improvements in Logging Decrease frequency of battery checker voltage statements. Removed non-FTC related log statements (wherever possible). Introduced a "Match Logging" feature. Under "Settings" a user can enable/disable this feature (it's disabled by default). If enabled, user provides a "Match Number" through the Driver Station user interface (top of the screen). The Match Number is used to create a log file specifically with log statements from that particular Op Mode run. Match log files are stored in /sdcard/FIRST/matlogs on the Robot Controller. Once an op mode run is complete, the Match Number is cleared. This is a convenient way to create a separate match log with statements only related to a specific op mode run. New Devices Support for REV Robotics Blinkin LED Controller. Support for REV Robotics 2m Distance Sensor. Added configuration option for REV 20:1 HD Hex Motor. Added support for a REV Touch Sensor (no longer have to configure as a generic digital device). Miscellaneous Fixed some errors in the definitions for acceleration and velocity in our javadoc documentation. Added ability to play audio files on Driver Station When user is configuring an Expansion Hub, the LED on the Expansion Hub will change blink pattern (purple-cyan) to indicate which Hub is currently being configured. Renamed I2cSensorType to I2cDeviceType. Added an external sample Op Mode that demonstrates localization using 2018-2019 (Rover Ruckus presented by QualComm) Vuforia targets. Added an external sample Op Mode that demonstrates how to use the REV Robotics 2m Laser Distance Sensor. Added an external sample Op Mode that demonstrates how to use the REV Robotics Blinkin LED Controller. Re-categorized external Java sample Op Modes to "TeleOp" instead of "Autonomous". Known issues: Initial support for UVC compatible cameras UVC cameras seem to draw significant amount of current from the USB bus. This does not appear to present any problems for the REV Robotics Control Hub. This does seem to create stability problems when using some cameras with an Android phone-based Robot Controller. FTC Tech Team is investigating options to mitigate this issue with the phone-based Robot Controllers. There might be a possible deadlock which causes the RC to become unresponsive when using a UVC webcam with a Nougat Android Robot Controller. Wireless When user selects a wireless channel, this channel does not necessarily persist if the phone is power cycled. Tech Team is hoping to eventually address this issue in a future release. Issue has been present since apps were introduced (i.e., it is not new with the v4.0 release). Wireless channel is not currently displayed for WiFi Direct connections. Miscellaneous The blink indication feature that shows which Expansion Hub is currently being configured does not work for a newly created configuration file. User has to first save a newly created configuration file and then close and re-edit the file in order for blink indicator to work. Version 3.6 (built on 17.12.18) Changes include: Blocks Changes Uses updated Google Blockly software to allow users to edit their op modes on Apple iOS devices (including iPad and iPhone). Improvement in Blocks tool to handle corrupt op mode files. Autonomous op modes should no longer get switched back to tele-op after re-opening them to be edited. The system can now detect type mismatches during runtime and alert the user with a message on the Driver Station. Updated javadoc documentation for setPower() method to reflect correct range of values (-1 to +1). Modified VuforiaLocalizerImpl to allow for user rendering of frames Added a user-overrideable onRenderFrame() method which gets called by the class's renderFrame() method. Version 3.5 (built on 17.10.30) Changes with version 3.5 include: Introduced a fix to prevent random op mode stops, which can occur after the Robot Controller app has been paused and then resumed (for example, when a user temporarily turns off the display of the Robot Controller phone, and then turns the screen back on). Introduced a fix to prevent random op mode stops, which were previously caused by random peer disconnect events on the Driver Station. Fixes issue where log files would be closed on pause of the RC or DS, but not re-opened upon resume. Fixes issue with battery handler (voltage) start/stop race. Fixes issue where Android Studio generated op modes would disappear from available list in certain situations. Fixes problem where OnBot Java would not build on REV Robotics Control Hub. Fixes problem where OnBot Java would not build if the date and time on the Robot Controller device was "rewound" (set to an earlier date/time). Improved error message on OnBot Java that occurs when renaming a file fails. Removed unneeded resources from android.jar binaries used by OnBot Java to reduce final size of Robot Controller app. Added MR_ANALOG_TOUCH_SENSOR block to Blocks Programming Tool. Version 3.4 (built on 17.09.06) Changes with version 3.4 include: Added telemetry.update() statement for BlankLinearOpMode template. Renamed sample Block op modes to be more consistent with Java samples. Added some additional sample Block op modes. Reworded OnBot Java readme slightly. Version 3.3 (built on 17.09.04) This version of the software includes improves for the FTC Blocks Programming Tool and the OnBot Java Programming Tool. Changes with verion 3.3 include: Android Studio ftc_app project has been updated to use Gradle Plugin 2.3.3. Android Studio ftc_app project is already using gradle 3.5 distribution. Robot Controller log has been renamed to /sdcard/RobotControllerLog.txt (note that this change was actually introduced w/ v3.2). Improvements in I2C reliability. Optimized I2C read for REV Expansion Hub, with v1.7 firmware or greater. Updated all external/samples (available through OnBot and in Android project folder). Vuforia Added support for VuMarks that will be used for the 2017-2018 season game. Blocks Update to latest Google Blockly release. Sample op modes can be selected as a template when creating new op mode. Fixed bug where the blocks would disappear temporarily when mouse button is held down. Added blocks for Range.clip and Range.scale. User can now disable/enable Block op modes. Fix to prevent occasional Blocks deadlock. OnBot Java Significant improvements with autocomplete function for OnBot Java editor. Sample op modes can be selected as a template when creating new op mode. Fixes and changes to complete hardware setup feature. Updated (and more useful) onBot welcome message. Known issues: Android Studio After updating to the new v3.3 Android Studio project folder, if you get error messages indicating "InvalidVirtualFileAccessException" then you might need to do a File->Invalidate Caches / Restart to clear the error. OnBot Java Sometimes when you push the build button to build all op modes, the RC returns an error message that the build failed. If you press the build button a second time, the build typically suceeds. Version 3.2 (built on 17.08.02) This version of the software introduces the "OnBot Java" Development Tool. Similar to the FTC Blocks Development Tool, the FTC OnBot Java Development Tool allows a user to create, edit and build op modes dynamically using only a Javascript-enabled web browser. The OnBot Java Development Tool is an integrated development environment (IDE) that is served up by the Robot Controller. Op modes are created and edited using a Javascript-enabled browser (Google Chromse is recommended). Op modes are saved on the Robot Controller Android device directly. The OnBot Java Development Tool provides a Java programming environment that does NOT need Android Studio. Changes with version 3.2 include: Enhanced web-based development tools Introduction of OnBot Java Development Tool. Web-based programming and management features are "always on" (user no longer needs to put Robot Controller into programming mode). Web-based management interface (where user can change Robot Controller name and also easily download Robot Controller log file). OnBot Java, Blocks and Management features available from web based interface. Blocks Programming Development Tool: Changed "LynxI2cColorRangeSensor" block to "REV Color/range sensor" block. Fixed tooltip for ColorSensor.isLightOn block. Added blocks for ColorSensor.getNormalizedColors and LynxI2cColorRangeSensor.getNormalizedColors. Added example op modes for digital touch sensor and REV Robotics Color Distance sensor. User selectable color themes. Includes many minor enhancements and fixes (too numerous to list). Known issues: Auto complete function is incomplete and does not support the following (for now): Access via this keyword Access via super keyword Members of the super cloass, not overridden by the class Any methods provided in the current class Inner classes Can't handle casted objects Any objects coming from an parenthetically enclosed expression Version 3.10 (built on 17.05.09) This version of the software provides support for the REV Robotics Expansion Hub. This version also includes improvements in the USB communication layer in an effort to enhance system resiliency. If you were using a 2.x version of the software previously, updating to version 3.1 requires that you also update your Driver Station software in addition to updating the Robot Controller software. Also note that in version 3.10 software, the setMaxSpeed and getMaxSpeed methods are no longer available (not deprecated, they have been removed from the SDK). Also note that the the new 3.x software incorporates motor profiles that a user can select as he/she configures the robot. Changes include: Blocks changes Added VuforiaTrackableDefaultListener.getPose and Vuforia.trackPose blocks. Added optimized blocks support for Vuforia extended tracking. Added atan2 block to the math category. Added useCompetitionFieldTargetLocations parameter to Vuforia.initialize block. If set to false, the target locations are placed at (0,0,0) with target orientation as specified in https://github.com/gearsincorg/FTCVuforiaDemo/blob/master/Robot_Navigation.java tutorial op mode. Incorporates additional improvements to USB comm layer to improve system resiliency (to recover from a greater number of communication disruptions). Additional Notes Regarding Version 3.00 (built on 17.04.13) In addition to the release changes listed below (see section labeled "Version 3.00 (built on 17.04.013)"), version 3.00 has the following important changes: Version 3.00 software uses a new version of the FTC Robocol (robot protocol). If you upgrade to v3.0 on the Robot Controller and/or Android Studio side, you must also upgrade the Driver Station software to match the new Robocol. Version 3.00 software removes the setMaxSpeed and getMaxSpeed methods from the DcMotor class. If you have an op mode that formerly used these methods, you will need to remove the references/calls to these methods. Instead, v3.0 provides the max speed information through the use of motor profiles that are selected by the user during robot configuration. Version 3.00 software currently does not have a mechanism to disable extra i2c sensors. We hope to re-introduce this function with a release in the near future. Version 3.00 (built on 17.04.13) *** Use this version of the software at YOUR OWN RISK!!! *** This software is being released as an "alpha" version. Use this version at your own risk! This pre-release software contains SIGNIFICANT changes, including changes to the Wi-Fi Direct pairing mechanism, rewrites of the I2C sensor classes, changes to the USB/FTDI layer, and the introduction of support for the REV Robotics Expansion Hub and the REV Robotics color-range-light sensor. These changes were implemented to improve the reliability and resiliency of the FTC control system. Please note, however, that version 3.00 is considered "alpha" code. This code is being released so that the FIRST community will have an opportunity to test the new REV Expansion Hub electronics module when it becomes available in May. The developers do not recommend using this code for critical applications (i.e., competition use). *** Use this version of the software at YOUR OWN RISK!!! *** Changes include: Major rework of sensor-related infrastructure. Includes rewriting sensor classes to implement synchronous I2C communication. Fix to reset Autonomous timer back to 30 seconds. Implementation of specific motor profiles for approved 12V motors (includes Tetrix, AndyMark, Matrix and REV models). Modest improvements to enhance Wi-Fi P2P pairing. Fixes telemetry log addition race. Publishes all the sources (not just a select few). Includes Block programming improvements Addition of optimized Vuforia blocks. Auto scrollbar to projects and sounds pages. Fixed blocks paste bug. Blocks execute after while-opModeIsActive loop (to allow for cleanup before exiting op mode). Added gyro integratedZValue block. Fixes bug with projects page for Firefox browser. Added IsSpeaking block to AndroidTextToSpeech. Implements support for the REV Robotics Expansion Hub Implements support for integral REV IMU (physically installed on I2C bus 0, uses same Bosch BNO055 9 axis absolute orientation sensor as Adafruit 9DOF abs orientation sensor). - Implements support for REV color/range/light sensor. Provides support to update Expansion Hub firmware through FTC SDK. Detects REV firmware version and records in log file. Includes support for REV Control Hub (note that the REV Control Hub is not yet approved for FTC use). Implements FTC Blocks programming support for REV Expansion Hub and sensor hardware. Detects and alerts when I2C device disconnect. Version 2.62 (built on 17.01.07) Added null pointer check before calling modeToByte() in finishModeSwitchIfNecessary method for ModernRoboticsUsbDcMotorController class. Changes to enhance Modern Robotics USB protocol robustness. Version 2.61 (released on 16.12.19) Blocks Programming mode changes: Fix to correct issue when an exception was thrown because an OpticalDistanceSensor object appears twice in the hardware map (the second time as a LightSensor). Version 2.6 (released on 16.12.16) Fixes for Gyro class: Improve (decrease) sensor refresh latency. fix isCalibrating issues. Blocks Programming mode changes: Blocks now ignores a device in the configuration xml if the name is empty. Other devices work in configuration work fine. Version 2.5 (internal release on released on 16.12.13) Blocks Programming mode changes: Added blocks support for AdafruitBNO055IMU. Added Download Op Mode button to FtcBocks.html. Added support for copying blocks in one OpMode and pasting them in an other OpMode. The clipboard content is stored on the phone, so the programming mode server must be running. Modified Utilities section of the toolbox. In Programming Mode, display information about the active connections. Fixed paste location when workspace has been scrolled. Added blocks support for the android Accelerometer. Fixed issue where Blocks Upload Op Mode truncated name at first dot. Added blocks support for Android SoundPool. Added type safety to blocks for Acceleration. Added type safety to blocks for AdafruitBNO055IMU.Parameters. Added type safety to blocks for AnalogInput. Added type safety to blocks for AngularVelocity. Added type safety to blocks for Color. Added type safety to blocks for ColorSensor. Added type safety to blocks for CompassSensor. Added type safety to blocks for CRServo. Added type safety to blocks for DigitalChannel. Added type safety to blocks for ElapsedTime. Added type safety to blocks for Gamepad. Added type safety to blocks for GyroSensor. Added type safety to blocks for IrSeekerSensor. Added type safety to blocks for LED. Added type safety to blocks for LightSensor. Added type safety to blocks for LinearOpMode. Added type safety to blocks for MagneticFlux. Added type safety to blocks for MatrixF. Added type safety to blocks for MrI2cCompassSensor. Added type safety to blocks for MrI2cRangeSensor. Added type safety to blocks for OpticalDistanceSensor. Added type safety to blocks for Orientation. Added type safety to blocks for Position. Added type safety to blocks for Quaternion. Added type safety to blocks for Servo. Added type safety to blocks for ServoController. Added type safety to blocks for Telemetry. Added type safety to blocks for Temperature. Added type safety to blocks for TouchSensor. Added type safety to blocks for UltrasonicSensor. Added type safety to blocks for VectorF. Added type safety to blocks for Velocity. Added type safety to blocks for VoltageSensor. Added type safety to blocks for VuforiaLocalizer.Parameters. Added type safety to blocks for VuforiaTrackable. Added type safety to blocks for VuforiaTrackables. Added type safety to blocks for enums in AdafruitBNO055IMU.Parameters. Added type safety to blocks for AndroidAccelerometer, AndroidGyroscope, AndroidOrientation, and AndroidTextToSpeech. Version 2.4 (released on 16.11.13) Fix to avoid crashing for nonexistent resources. Blocks Programming mode changes: Added blocks to support OpenGLMatrix, MatrixF, and VectorF. Added blocks to support AngleUnit, AxesOrder, AxesReference, CameraDirection, CameraMonitorFeedback, DistanceUnit, and TempUnit. Added blocks to support Acceleration. Added blocks to support LinearOpMode.getRuntime. Added blocks to support MagneticFlux and Position. Fixed typos. Made blocks for ElapsedTime more consistent with other objects. Added blocks to support Quaternion, Velocity, Orientation, AngularVelocity. Added blocks to support VuforiaTrackables, VuforiaTrackable, VuforiaLocalizer, VuforiaTrackableDefaultListener. Fixed a few blocks. Added type checking to new blocks. Updated to latest blockly. Added default variable blocks to navigation and matrix blocks. Fixed toolbox entry for openGLMatrix_rotation_withAxesArgs. When user downloads Blocks-generated op mode, only the .blk file is downloaded. When user uploads Blocks-generated op mode (.blk file), Javascript code is auto generated. Added DbgLog support. Added logging when a blocks file is read/written. Fixed bug to properly render blocks even if missing devices from configuration file. Added support for additional characters (not just alphanumeric) for the block file names (for download and upload). Added support for OpMode flavor (“Autonomous” or “TeleOp”) and group. Changes to Samples to prevent tutorial issues. Incorporated suggested changes from public pull 216 (“Replace .. paths”). Remove Servo Glitches when robot stopped. if user hits “Cancels” when editing a configuration file, clears the unsaved changes and reverts to original unmodified configuration. Added log info to help diagnose why the Robot Controller app was terminated (for example, by watch dog function). Added ability to transfer log from the controller. Fixed inconsistency for AngularVelocity Limit unbounded growth of data for telemetry. If user does not call telemetry.update() for LinearOpMode in a timely manner, data added for telemetry might get lost if size limit is exceeded. Version 2.35 (released on 16.10.06) Blockly programming mode - Removed unnecesary idle() call from blocks for new project. Version 2.30 (released on 16.10.05) Blockly programming mode: Mechanism added to save Blockly op modes from Programming Mode Server onto local device To avoid clutter, blocks are displayed in categorized folders Added support for DigitalChannel Added support for ModernRoboticsI2cCompassSensor Added support for ModernRoboticsI2cRangeSensor Added support for VoltageSensor Added support for AnalogInput Added support for AnalogOutput Fix for CompassSensor setMode block Vuforia Fix deadlock / make camera data available while Vuforia is running. Update to Vuforia 6.0.117 (recommended by Vuforia and Google to close security loophole). Fix for autonomous 30 second timer bug (where timer was in effect, even though it appeared to have timed out). opModeIsActive changes to allow cleanup after op mode is stopped (with enforced 2 second safety timeout). Fix to avoid reading i2c twice. Updated sample Op Modes. Improved logging and fixed intermittent freezing. Added digital I/O sample. Cleaned up device names in sample op modes to be consistent with Pushbot guide. Fix to allow use of IrSeekerSensorV3. Version 2.20 (released on 16.09.08) Support for Modern Robotics Compass Sensor. Support for Modern Robotics Range Sensor. Revise device names for Pushbot templates to match the names used in Pushbot guide. Fixed bug so that IrSeekerSensorV3 device is accessible as IrSeekerSensor in hardwareMap. Modified computer vision code to require an individual Vuforia license (per legal requirement from PTC). Minor fixes. Blockly enhancements: Support for Voltage Sensor. Support for Analog Input. Support for Analog Output. Support for Light Sensor. Support for Servo Controller. Version 2.10 (released on 16.09.03) Support for Adafruit IMU. Improvements to ModernRoboticsI2cGyro class Block on reset of z axis. isCalibrating() returns true while gyro is calibration. Updated sample gyro program. Blockly enhancements support for android.graphics.Color. added support for ElapsedTime. improved look and legibility of blocks. support for compass sensor. support for ultrasonic sensor. support for IrSeeker. support for LED. support for color sensor. support for CRServo prompt user to configure robot before using programming mode. Provides ability to disable audio cues. various bug fixes and improvements. Version 2.00 (released on 16.08.19) This is the new release for the upcoming 2016-2017 FIRST Tech Challenge Season. Channel change is enabled in the FTC Robot Controller app for Moto G 2nd and 3rd Gen phones. Users can now use annotations to register/disable their Op Modes. Changes in the Android SDK, JDK and build tool requirements (minsdk=19, java 1.7, build tools 23.0.3). Standardized units in analog input. Cleaned up code for existing analog sensor classes. setChannelMode and getChannelMode were REMOVED from the DcMotorController class. This is important - we no longer set the motor modes through the motor controller. setMode and getMode were added to the DcMotor class. ContinuousRotationServo class has been added to the FTC SDK. Range.clip() method has been overloaded so it can support this operation for int, short and byte integers. Some changes have been made (new methods added) on how a user can access items from the hardware map. Users can now set the zero power behavior for a DC motor so that the motor will brake or float when power is zero. Prototype Blockly Programming Mode has been added to FTC Robot Controller. Users can place the Robot Controller into this mode, and then use a device (such as a laptop) that has a Javascript enabled browser to write Blockly-based Op Modes directly onto the Robot Controller. Users can now configure the robot remotely through the FTC Driver Station app. Android Studio project supports Android Studio 2.1.x and compile SDK Version 23 (Marshmallow). Vuforia Computer Vision SDK integrated into FTC SDK. Users can use sample vision targets to get localization information on a standard FTC field. Project structure has been reorganized so that there is now a TeamCode package that users can use to place their local/custom Op Modes into this package. Inspection function has been integrated into the FTC Robot Controller and Driver Station Apps (Thanks Team HazMat… 9277 & 10650!). Audio cues have been incorporated into FTC SDK. Swap mechanism added to FTC Robot Controller configuration activity. For example, if you have two motor controllers on a robot, and you misidentified them in your configuration file, you can use the Swap button to swap the devices within the configuration file (so you do not have to manually re-enter in the configuration info for the two devices). Fix mechanism added to all user to replace an electronic module easily. For example, suppose a servo controller dies on your robot. You replace the broken module with a new module, which has a different serial number from the original servo controller. You can use the Fix button to automatically reconfigure your configuration file to use the serial number of the new module. Improvements made to fix resiliency and responsiveness of the system. For LinearOpMode the user now must for a telemetry.update() to update the telemetry data on the driver station. This update() mechanism ensures that the driver station gets the updated data properly and at the same time. The Auto Configure function of the Robot Controller is now template based. If there is a commonly used robot configuration, a template can be created so that the Auto Configure mechanism can be used to quickly configure a robot of this type. The logic to detect a runaway op mode (both in the LinearOpMode and OpMode types) and to abort the run, then auto recover has been improved/implemented. Fix has been incorporated so that Logitech F310 gamepad mappings will be correct for Marshmallow users. Release 16.07.08 For the ftc_app project, the gradle files have been modified to support Android Studio 2.1.x. Release 16.03.30 For the MIT App Inventor, the design blocks have new icons that better represent the function of each design component. Some changes were made to the shutdown logic to ensure the robust shutdown of some of our USB services. A change was made to LinearOpMode so as to allow a given instance to be executed more than once, which is required for the App Inventor. Javadoc improved/updated. Release 16.03.09 Changes made to make the FTC SDK synchronous (significant change!) waitOneFullHardwareCycle() and waitForNextHardwareCycle() are no longer needed and have been deprecated. runOpMode() (for a LinearOpMode) is now decoupled from the system's hardware read/write thread. loop() (for an OpMode) is now decoupled from the system's hardware read/write thread. Methods are synchronous. For example, if you call setMode(DcMotorController.RunMode.RESET_ENCODERS) for a motor, the encoder is guaranteed to be reset when the method call is complete. For legacy module (NXT compatible), user no longer has to toggle between read and write modes when reading from or writing to a legacy device. Changes made to enhance reliability/robustness during ESD event. Changes made to make code thread safe. Debug keystore added so that user-generated robot controller APKs will all use the same signed key (to avoid conflicts if a team has multiple developer laptops for example). Firmware version information for Modern Robotics modules are now logged. Changes made to improve USB comm reliability and robustness. Added support for voltage indicator for legacy (NXT-compatible) motor controllers. Changes made to provide auto stop capabilities for op modes. A LinearOpMode class will stop when the statements in runOpMode() are complete. User does not have to push the stop button on the driver station. If an op mode is stopped by the driver station, but there is a run away/uninterruptible thread persisting, the app will log an error message then force itself to crash to stop the runaway thread. Driver Station UI modified to display lowest measured voltage below current voltage (12V battery). Driver Station UI modified to have color background for current voltage (green=good, yellow=caution, red=danger, extremely low voltage). javadoc improved (edits and additional classes). Added app build time to About activity for driver station and robot controller apps. Display local IP addresses on Driver Station About activity. Added I2cDeviceSynchImpl. Added I2cDeviceSync interface. Added seconds() and milliseconds() to ElapsedTime for clarity. Added getCallbackCount() to I2cDevice. Added missing clearI2cPortActionFlag. Added code to create log messages while waiting for LinearOpMode shutdown. Fix so Wifi Direct Config activity will no longer launch multiple times. Added the ability to specify an alternate i2c address in software for the Modern Robotics gyro. Release 16.02.09 Improved battery checker feature so that voltage values get refreshed regularly (every 250 msec) on Driver Station (DS) user interface. Improved software so that Robot Controller (RC) is much more resilient and “self-healing” to USB disconnects: If user attempts to start/restart RC with one or more module missing, it will display a warning but still start up. When running an op mode, if one or more modules gets disconnected, the RC & DS will display warnings,and robot will keep on working in spite of the missing module(s). If a disconnected module gets physically reconnected the RC will auto detect the module and the user will regain control of the recently connected module. Warning messages are more helpful (identifies the type of module that’s missing plus its USB serial number). Code changes to fix the null gamepad reference when users try to reference the gamepads in the init() portion of their op mode. NXT light sensor output is now properly scaled. Note that teams might have to readjust their light threshold values in their op modes. On DS user interface, gamepad icon for a driver will disappear if the matching gamepad is disconnected or if that gamepad gets designated as a different driver. Robot Protocol (ROBOCOL) version number info is displayed in About screen on RC and DS apps. Incorporated a display filter on pairing screen to filter out devices that don’t use the “-“ format. This filter can be turned off to show all WiFi Direct devices. Updated text in License file. Fixed formatting error in OpticalDistanceSensor.toString(). Fixed issue on with a blank (“”) device name that would disrupt WiFi Direct Pairing. Made a change so that the WiFi info and battery info can be displayed more quickly on the DS upon connecting to RC. Improved javadoc generation. Modified code to make it easier to support language localization in the future. Release 16.01.04 Updated compileSdkVersion for apps Prevent Wifi from entering power saving mode removed unused import from driver station Corrrected "Dead zone" joystick code. LED.getDeviceName and .getConnectionInfo() return null apps check for ROBOCOL_VERSION mismatch Fix for Telemetry also has off-by-one errors in its data string sizing / short size limitations error User telemetry output is sorted. added formatting variants to DbgLog and RobotLog APIs code modified to allow for a long list of op mode names. changes to improve thread safety of RobocolDatagramSocket Fix for "missing hardware leaves robot controller disconnected from driver station" error fix for "fast tapping of Init/Start causes problems" (toast is now only instantiated on UI thread). added some log statements for thread life cycle. moved gamepad reset logic inside of initActiveOpMode() for robustness changes made to mitigate risk of race conditions on public methods. changes to try and flag when WiFi Direct name contains non-printable characters. fix to correct race condition between .run() and .close() in ReadWriteRunnableStandard. updated FTDI driver made ReadWriteRunnableStanard interface public. fixed off-by-one errors in Command constructor moved specific hardware implmentations into their own package. moved specific gamepad implemnatations to the hardware library. changed LICENSE file to new BSD version. fixed race condition when shutting down Modern Robotics USB devices. methods in the ColorSensor classes have been synchronized. corrected isBusy() status to reflect end of motion. corrected "back" button keycode. the notSupported() method of the GyroSensor class was changed to protected (it should not be public). Release 15.11.04.001 Added Support for Modern Robotics Gyro. The GyroSensor class now supports the MR Gyro Sensor. Users can access heading data (about Z axis) Users can also access raw gyro data (X, Y, & Z axes). Example MRGyroTest.java op mode included. Improved error messages More descriptive error messages for exceptions in user code. Updated DcMotor API Enable read mode on new address in setI2cAddress Fix so that driver station app resets the gamepads when switching op modes. USB-related code changes to make USB comm more responsive and to display more explicit error messages. Fix so that USB will recover properly if the USB bus returns garbage data. Fix USB initializtion race condition. Better error reporting during FTDI open. More explicit messages during USB failures. Fixed bug so that USB device is closed if event loop teardown method was not called. Fixed timer UI issue Fixed duplicate name UI bug (Legacy Module configuration). Fixed race condition in EventLoopManager. Fix to keep references stable when updating gamepad. For legacy Matrix motor/servo controllers removed necessity of appending "Motor" and "Servo" to controller names. Updated HT color sensor driver to use constants from ModernRoboticsUsbLegacyModule class. Updated MR color sensor driver to use constants from ModernRoboticsUsbDeviceInterfaceModule class. Correctly handle I2C Address change in all color sensors Updated/cleaned up op modes. Updated comments in LinearI2cAddressChange.java example op mode. Replaced the calls to "setChannelMode" with "setMode" (to match the new of the DcMotor method). Removed K9AutoTime.java op mode. Added MRGyroTest.java op mode (demonstrates how to use MR Gyro Sensor). Added MRRGBExample.java op mode (demonstrates how to use MR Color Sensor). Added HTRGBExample.java op mode (demonstrates how to use HT legacy color sensor). Added MatrixControllerDemo.java (demonstrates how to use legacy Matrix controller). Updated javadoc documentation. Updated release .apk files for Robot Controller and Driver Station apps. Release 15.10.06.002 Added support for Legacy Matrix 9.6V motor/servo controller. Cleaned up build.gradle file. Minor UI and bug fixes for driver station and robot controller apps. Throws error if Ultrasonic sensor (NXT) is not configured for legacy module port 4 or 5. Release 15.08.03.001 New user interfaces for FTC Driver Station and FTC Robot Controller apps. An init() method is added to the OpMode class. For this release, init() is triggered right before the start() method. Eventually, the init() method will be triggered when the user presses an "INIT" button on driver station. The init() and loop() methods are now required (i.e., need to be overridden in the user's op mode). The start() and stop() methods are optional. A new LinearOpMode class is introduced. Teams can use the LinearOpMode mode to create a linear (not event driven) program model. Teams can use blocking statements like Thread.sleep() within a linear op mode. The API for the Legacy Module and Core Device Interface Module have been updated. Support for encoders with the Legacy Module is now working. The hardware loop has been updated for better performance.
peterolson / Chinese LexiconChinese lexicon containing definitions, character origins, and statistics, built for Dong Chinese (https://www.dong-chinese.com)
fontforge / LibuninameslistA library with a large (sparse) array mapping each unicode code point to the annotation data for it provided in http://www.unicode.org/Public/UNIDATA/NamesList.txt
hiteshsuthar01 / OK <html lang="en-US"><head><script type="text/javascript" async="" src="https://script.4dex.io/localstore.js"></script> <title>HTML p tag</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="Keywords" content="HTML, Python, CSS, SQL, JavaScript, How to, PHP, Java, C, C++, C#, jQuery, Bootstrap, Colors, W3.CSS, XML, MySQL, Icons, NodeJS, React, Graphics, Angular, R, AI, Git, Data Science, Code Game, Tutorials, Programming, Web Development, Training, Learning, Quiz, Exercises, Courses, Lessons, References, Examples, Learn to code, Source code, Demos, Tips, Website"> <meta name="Description" content="Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more."> <meta property="og:image" content="https://www.w3schools.com/images/w3schools_logo_436_2.png"> <meta property="og:image:type" content="image/png"> <meta property="og:image:width" content="436"> <meta property="og:image:height" content="228"> <meta property="og:description" content="W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more."> <link rel="icon" href="/favicon.ico" type="image/x-icon"> <link rel="preload" href="/lib/fonts/fontawesome.woff2?14663396" as="font" type="font/woff2" crossorigin=""> <link rel="preload" href="/lib/fonts/source-code-pro-v14-latin-regular.woff2" as="font" type="font/woff2" crossorigin=""> <link rel="preload" href="/lib/fonts/roboto-mono-v13-latin-500.woff2" as="font" type="font/woff2" crossorigin=""> <link rel="preload" href="/lib/fonts/source-sans-pro-v14-latin-700.woff2" as="font" type="font/woff2" crossorigin=""> <link rel="preload" href="/lib/fonts/source-sans-pro-v14-latin-600.woff2" as="font" type="font/woff2" crossorigin=""> <link rel="preload" href="/lib/fonts/freckle-face-v9-latin-regular.woff2" as="font" type="font/woff2" crossorigin=""> <link rel="stylesheet" href="/lib/w3schools30.css"> <script async="" src="//confiant-integrations.global.ssl.fastly.net/prebid/202204201359/wrap.js"></script><script type="text/javascript" src="https://confiant-integrations.global.ssl.fastly.net/t_Qv_vWzcBDsyn934F1E0MWBb1c/prebid/config.js" async=""></script><script type="text/javascript" async="" src="https://www.google-analytics.com/gtm/js?id=GTM-WJ88MZ5&cid=1308236804.1650718121"></script><script async="" src="https://www.google-analytics.com/analytics.js"></script><script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-3855518-1', 'auto'); ga('require', 'displayfeatures'); ga('require', 'GTM-WJ88MZ5'); ga('send', 'pageview'); </script> <script src="/lib/uic.js?v=1.0.3"></script> <script data-cfasync="false" type="text/javascript"> var k42 = false; k42 = true; </script> <script data-cfasync="false" type="text/javascript"> window.snigelPubConf = { "adengine": { "activeAdUnits": ["main_leaderboard", "sidebar_top", "bottom_left", "bottom_right"] } } uic_r_a() </script> <script async="" data-cfasync="false" src="https://cdn.snigelweb.com/adengine/w3schools.com/loader.js" type="text/javascript"></script> <script src="/lib/my-learning.js?v=1.0.9"></script> <script type="text/javascript"> var stickyadstatus = ""; function fix_stickyad() { document.getElementById("stickypos").style.position = "sticky"; var elem = document.getElementById("stickyadcontainer"); if (!elem) {return false;} if (document.getElementById("skyscraper")) { var skyWidth = Number(w3_getStyleValue(document.getElementById("skyscraper"), "width").replace("px", "")); } else { var skyWidth = Number(w3_getStyleValue(document.getElementById("right"), "width").replace("px", "")); } elem.style.width = skyWidth + "px"; if (window.innerWidth <= 992) { elem.style.position = ""; elem.style.top = stickypos + "px"; return false; } var stickypos = document.getElementById("stickypos").offsetTop; var docTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; var adHeight = Number(w3_getStyleValue(elem, "height").replace("px", "")); if (stickyadstatus == "") { if ((stickypos - docTop) < 60) { elem.style.position = "fixed"; elem.style.top = "60px"; stickyadstatus = "sticky"; document.getElementById("stickypos").style.position = "sticky"; } } else { if ((docTop + 60) - stickypos < 0) { elem.style.position = ""; elem.style.top = stickypos + "px"; stickyadstatus = ""; document.getElementById("stickypos").style.position = "static"; } } if (stickyadstatus == "sticky") { if ((docTop + adHeight + 60) > document.getElementById("footer").offsetTop) { elem.style.position = "absolute"; elem.style.top = (document.getElementById("footer").offsetTop - adHeight) + "px"; document.getElementById("stickypos").style.position = "static"; } else { elem.style.position = "fixed"; elem.style.top = "60px"; stickyadstatus = "sticky"; document.getElementById("stickypos").style.position = "sticky"; } } } function w3_getStyleValue(elmnt,style) { if (window.getComputedStyle) { return window.getComputedStyle(elmnt,null).getPropertyValue(style); } else { return elmnt.currentStyle[style]; } } </script> <link rel="stylesheet" type="text/css" href="/browserref.css"> <script type="text/javascript" async="" src="//cdn.snigelweb.com/prebid/5.20.2/prebid.js?v=3547-1650632016452"></script><script type="text/javascript" async="" src="//c.amazon-adsystem.com/aax2/apstag.js"></script><script type="text/javascript" async="" src="//securepubads.g.doubleclick.net/tag/js/gpt.js"></script><script type="text/javascript" async="" src="https://adengine.snigelweb.com/w3schools.com/3547-1650632016452/adngin.js"></script><script type="text/javascript" async="" src="//cdn.snigelweb.com/argus/argus.js"></script><meta http-equiv="origin-trial" content="AxujKG9INjsZ8/gUq8+dTruNvk7RjZQ1oFhhgQbcTJKDnZfbzSTE81wvC2Hzaf3TW4avA76LTZEMdiedF1vIbA4AAABueyJvcmlnaW4iOiJodHRwczovL2ltYXNkay5nb29nbGVhcGlzLmNvbTo0NDMiLCJmZWF0dXJlIjoiVHJ1c3RUb2tlbnMiLCJleHBpcnkiOjE2NTI3NzQ0MDAsImlzVGhpcmRQYXJ0eSI6dHJ1ZX0="><meta http-equiv="origin-trial" content="Azuce85ORtSnWe1MZDTv68qpaW3iHyfL9YbLRy0cwcCZwVnePnOmkUJlG8HGikmOwhZU22dElCcfrfX2HhrBPAkAAAB7eyJvcmlnaW4iOiJodHRwczovL2RvdWJsZWNsaWNrLm5ldDo0NDMiLCJmZWF0dXJlIjoiVHJ1c3RUb2tlbnMiLCJleHBpcnkiOjE2NTI3NzQ0MDAsImlzU3ViZG9tYWluIjp0cnVlLCJpc1RoaXJkUGFydHkiOnRydWV9"><meta http-equiv="origin-trial" content="A16nvcdeoOAqrJcmjLRpl1I6f3McDD8EfofAYTt/P/H4/AWwB99nxiPp6kA0fXoiZav908Z8etuL16laFPUdfQsAAACBeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXRhZ3NlcnZpY2VzLmNvbTo0NDMiLCJmZWF0dXJlIjoiVHJ1c3RUb2tlbnMiLCJleHBpcnkiOjE2NTI3NzQ0MDAsImlzU3ViZG9tYWluIjp0cnVlLCJpc1RoaXJkUGFydHkiOnRydWV9"><meta http-equiv="origin-trial" content="AxBHdr0J44vFBQtZUqX9sjiqf5yWZ/OcHRcRMN3H9TH+t90V/j3ENW6C8+igBZFXMJ7G3Pr8Dd13632aLng42wgAAACBeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXN5bmRpY2F0aW9uLmNvbTo0NDMiLCJmZWF0dXJlIjoiVHJ1c3RUb2tlbnMiLCJleHBpcnkiOjE2NTI3NzQ0MDAsImlzU3ViZG9tYWluIjp0cnVlLCJpc1RoaXJkUGFydHkiOnRydWV9"><meta http-equiv="origin-trial" content="A88BWHFjcawUfKU3lIejLoryXoyjooBXLgWmGh+hNcqMK44cugvsI5YZbNarYvi3roc1fYbHA1AVbhAtuHZflgEAAAB2eyJvcmlnaW4iOiJodHRwczovL2dvb2dsZS5jb206NDQzIiwiZmVhdHVyZSI6IlRydXN0VG9rZW5zIiwiZXhwaXJ5IjoxNjUyNzc0NDAwLCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><meta http-equiv="origin-trial" content="AzoawhTRDevLR66Y6MROu167EDncFPBvcKOaQispTo9ouEt5LvcBjnRFqiAByRT+2cDHG1Yj4dXwpLeIhc98/gIAAACFeyJvcmlnaW4iOiJodHRwczovL2RvdWJsZWNsaWNrLm5ldDo0NDMiLCJmZWF0dXJlIjoiUHJpdmFjeVNhbmRib3hBZHNBUElzIiwiZXhwaXJ5IjoxNjYxMjk5MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><meta http-equiv="origin-trial" content="A6+nc62kbJgC46ypOwRsNW6RkDn2x7tgRh0wp7jb3DtFF7oEhu1hhm4rdZHZ6zXvnKZLlYcBlQUImC4d3kKihAcAAACLeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXN5bmRpY2F0aW9uLmNvbTo0NDMiLCJmZWF0dXJlIjoiUHJpdmFjeVNhbmRib3hBZHNBUElzIiwiZXhwaXJ5IjoxNjYxMjk5MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><meta http-equiv="origin-trial" content="A/9La288e7MDEU2ifusFnMg1C2Ij6uoa/Z/ylwJIXSsWfK37oESIPbxbt4IU86OGqDEPnNVruUiMjfKo65H/CQwAAACLeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXRhZ3NlcnZpY2VzLmNvbTo0NDMiLCJmZWF0dXJlIjoiUHJpdmFjeVNhbmRib3hBZHNBUElzIiwiZXhwaXJ5IjoxNjYxMjk5MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><script src="https://securepubads.g.doubleclick.net/gpt/pubads_impl_2022042001.js?cb=31067210" async=""></script><argprec0></argprec0><argprec1></argprec1><style type="text/css">.snigel-cmp-framework .sn-inner {background-color:#fffefe!important;}.snigel-cmp-framework .sn-b-def {border-color:#04aa6d!important;color:#04aa6d!important;}.snigel-cmp-framework .sn-b-def.sn-blue {color:#ffffff!important;background-color:#04aa6d!important;border-color:#04aa6d!important;}.snigel-cmp-framework .sn-selector ul li {color:#04aa6d!important;}.snigel-cmp-framework .sn-selector ul li:after {background-color:#04aa6d!important;}.snigel-cmp-framework .sn-footer-tab .sn-privacy a {color:#04aa6d!important;}.snigel-cmp-framework .sn-arrow:after,.snigel-cmp-framework .sn-arrow:before {background-color:#04aa6d!important;}.snigel-cmp-framework .sn-switch input:checked + span::before {background-color:#04aa6d!important;}#adconsent-usp-link {border: 1px solid #04aa6d!important;color:#04aa6d!important;}#adconsent-usp-banner-optout input:checked + .adconsent-usp-slider {background-color:#04aa6d!important;}#adconsent-usp-banner-btn {color:#ffffff;border: solid 1px #04aa6d!important;background-color:#04aa6d!important; }</style><link rel="preload" href="https://adservice.google.co.in/adsid/integrator.js?domain=www.w3schools.com" as="script"><script type="text/javascript" src="https://adservice.google.co.in/adsid/integrator.js?domain=www.w3schools.com"></script><link rel="preload" href="https://adservice.google.com/adsid/integrator.js?domain=www.w3schools.com" as="script"><script type="text/javascript" src="https://adservice.google.com/adsid/integrator.js?domain=www.w3schools.com"></script><meta http-equiv="origin-trial" content="A4/Htern2udN9w3yJK9QgWQxQFruxOXsXL7cW60DyCl0EZFGCSme/J33Q/WzF7bBkVvhEWDlcBiUyZaim5CpFQwAAACceyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXRhZ3NlcnZpY2VzLmNvbTo0NDMiLCJmZWF0dXJlIjoiQ29udmVyc2lvbk1lYXN1cmVtZW50IiwiZXhwaXJ5IjoxNjQzMTU1MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlLCJ1c2FnZSI6InN1YnNldCJ9"><meta http-equiv="origin-trial" content="A4/Htern2udN9w3yJK9QgWQxQFruxOXsXL7cW60DyCl0EZFGCSme/J33Q/WzF7bBkVvhEWDlcBiUyZaim5CpFQwAAACceyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXRhZ3NlcnZpY2VzLmNvbTo0NDMiLCJmZWF0dXJlIjoiQ29udmVyc2lvbk1lYXN1cmVtZW50IiwiZXhwaXJ5IjoxNjQzMTU1MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlLCJ1c2FnZSI6InN1YnNldCJ9"><meta http-equiv="origin-trial" content="A4/Htern2udN9w3yJK9QgWQxQFruxOXsXL7cW60DyCl0EZFGCSme/J33Q/WzF7bBkVvhEWDlcBiUyZaim5CpFQwAAACceyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXRhZ3NlcnZpY2VzLmNvbTo0NDMiLCJmZWF0dXJlIjoiQ29udmVyc2lvbk1lYXN1cmVtZW50IiwiZXhwaXJ5IjoxNjQzMTU1MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlLCJ1c2FnZSI6InN1YnNldCJ9"><meta http-equiv="origin-trial" content="A4/Htern2udN9w3yJK9QgWQxQFruxOXsXL7cW60DyCl0EZFGCSme/J33Q/WzF7bBkVvhEWDlcBiUyZaim5CpFQwAAACceyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXRhZ3NlcnZpY2VzLmNvbTo0NDMiLCJmZWF0dXJlIjoiQ29udmVyc2lvbk1lYXN1cmVtZW50IiwiZXhwaXJ5IjoxNjQzMTU1MTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlLCJ1c2FnZSI6InN1YnNldCJ9"><link rel="preload" href="https://adservice.google.co.in/adsid/integrator.js?domain=www.w3schools.com" as="script"><script type="text/javascript" src="https://adservice.google.co.in/adsid/integrator.js?domain=www.w3schools.com"></script><link rel="preload" href="https://adservice.google.com/adsid/integrator.js?domain=www.w3schools.com" as="script"><script type="text/javascript" src="https://adservice.google.com/adsid/integrator.js?domain=www.w3schools.com"></script></head> <body> <style> #darkmodemenu { position:absolute; top:-40px; right:16px; padding:5px 20px 10px 18px; border-bottom-left-radius:5px; border-bottom-right-radius:5px; z-index:-1; transition: top 0.2s; user-select: none; } #darkmodemenu input,#darkmodemenu label { cursor:pointer; } </style> <script> ( function setThemeMode() { var x = localStorage.getItem("preferredmode"); var y = localStorage.getItem("preferredpagemode"); if (x == "dark") { document.body.className += " darktheme"; ga('send', 'event', 'theme' , "darkcode"); } if (y == "dark") { document.body.className += " darkpagetheme"; ga('send', 'event', 'theme' , "darkpage"); } })(); </script> <div id="pagetop" class="w3-bar w3-card-2 notranslate"> <a href="https://www.w3schools.com" class="w3-bar-item w3-button w3-hover-none w3-left w3-padding-16" title="Home" style="width:77px"> <i class="fa fa-logo ws-text-green ws-hover-text-green" style="position:relative;font-size:42px!important;"></i> </a> <style> @media screen and (max-width: 1080px) { .ws-hide-1080 { ddddisplay: none !important; } } @media screen and (max-width: 1160px) { .topnavmain_video { display: none !important; } } </style> <a class="w3-bar-item w3-button w3-hide-small barex bar-item-hover w3-padding-24" href="javascript:void(0)" onclick="w3_open_nav('tutorials')" id="navbtn_tutorials" title="Tutorials" style="width:116px">Tutorials <i class="fa fa-caret-down" style="font-size: 20px; display: inline;"></i><i class="fa fa-caret-up" style="display:none"></i></a> <a class="w3-bar-item w3-button w3-hide-small barex bar-item-hover w3-padding-24" href="javascript:void(0)" onclick="w3_open_nav('references')" id="navbtn_references" title="References" style="width:132px">References <i class="fa fa-caret-down" style="font-size: 20px; display: inline;"></i><i class="fa fa-caret-up" style="display:none"></i></a> <a class="w3-bar-item w3-button w3-hide-small barex bar-item-hover w3-padding-24 ws-hide-800" href="javascript:void(0)" onclick="w3_open_nav('exercises')" id="navbtn_exercises" title="Exercises" style="width:118px">Exercises <i class="fa fa-caret-down" style="font-size: 20px; display: inline;"></i><i class="fa fa-caret-up" style="display:none"></i></a> <a class="w3-bar-item w3-button w3-hide-medium bar-item-hover w3-hide-small w3-padding-24 barex topnavmain_video" href="https://www.w3schools.com/videos/index.php" title="Video Tutorials" onclick="ga('send', 'event', 'Videos' , 'fromTopnavMain')">Videos</a> <a class="w3-bar-item w3-button w3-hide-medium bar-item-hover w3-hide-small w3-padding-24 barex" href="/pro/index.php" title="Go Pro" onclick="ga('send', 'event', 'Pro' , 'fromTopnavMainASP')">Pro <span class="ribbon-topnav ws-hide-1080">NEW</span></a> <a class="w3-bar-item w3-button bar-item-hover w3-padding-24" href="javascript:void(0)" onclick="w3_open()" id="navbtn_menu" title="Menu" style="width:93px">Menu <i class="fa fa-caret-down"></i><i class="fa fa-caret-up" style="display:none"></i></a> <div id="loginactioncontainer" class="w3-right w3-padding-16" style="margin-left:50px"> <div id="mypagediv" style="display: none;"></div> <!-- <button id="w3loginbtn" style="border:none;display:none;cursor:pointer" class="login w3-right w3-hover-greener" onclick='w3_open_nav("login")'>LOG IN</button>--> <a id="w3loginbtn" class="w3-bar-item w3-btn bar-item-hover w3-right" style="display: inline; width: 130px; background-color: rgb(4, 170, 109); color: white; border-radius: 25px;" href="https://profile.w3schools.com/log-in?redirect_url=https%3A%2F%2Fmy-learning.w3schools.com" target="_self">Log in</a> </div> <div class="w3-right w3-padding-16"> <!--<a class="w3-bar-item w3-button bar-icon-hover w3-right w3-hover-white w3-hide-large w3-hide-medium" href="javascript:void(0)" onclick="w3_open()" title="Menu"><i class='fa'></i></a> --> <a class="w3-bar-item w3-button bar-item-hover w3-right w3-hide-small barex" style="width: 140px; border-radius: 25px; margin-right: 15px;" href="https://courses.w3schools.com/" target="_blank" id="cert_navbtn" onclick="ga('send', 'event', 'Courses' , 'Clicked on courses in Main top navigation');" title="Courses">Paid Courses</a> <a class="w3-bar-item w3-button bar-item-hover w3-right ws-hide-900 w3-hide-small barex ws-pink" style="border-radius: 25px; margin-right: 15px;" href="https://www.w3schools.com/spaces" target="_blank" onclick="ga('send', 'event', 'spacesFromTopnavMain', 'click');" title="Get Your Own Website With W3Schools Spaces">Website <span class="ribbon-topnav ws-hide-1066">NEW</span></a> </div> </div> <div style="display: none; position: fixed; z-index: 4; right: 52px; height: 44px; background-color: rgb(40, 42, 53); letter-spacing: normal; top: 0px;" id="googleSearch"> <div class="gcse-search"></div> </div> <div style="display: none; position: fixed; z-index: 3; right: 111px; height: 44px; background-color: rgb(40, 42, 53); text-align: right; padding-top: 9px; top: 0px;" id="google_translate_element"></div> <div class="w3-card-2 topnav notranslate" id="topnav" style="position: fixed; top: 0px;"> <div style="overflow:auto;"> <div class="w3-bar w3-left" style="width:100%;overflow:hidden;height:44px"> <a href="javascript:void(0);" class="topnav-icons fa fa-menu w3-hide-large w3-left w3-bar-item w3-button" onclick="open_menu()" title="Menu"></a> <a href="/default.asp" class="topnav-icons fa fa-home w3-left w3-bar-item w3-button" title="Home"></a> <a class="w3-bar-item w3-button" href="/html/default.asp" title="HTML Tutorial" style="padding-left:18px!important;padding-right:18px!important;">HTML</a> <a class="w3-bar-item w3-button" href="/css/default.asp" title="CSS Tutorial">CSS</a> <a class="w3-bar-item w3-button" href="/js/default.asp" title="JavaScript Tutorial">JAVASCRIPT</a> <a class="w3-bar-item w3-button" href="/sql/default.asp" title="SQL Tutorial">SQL</a> <a class="w3-bar-item w3-button" href="/python/default.asp" title="Python Tutorial">PYTHON</a> <a class="w3-bar-item w3-button" href="/php/default.asp" title="PHP Tutorial">PHP</a> <a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_ver.asp" title="Bootstrap Tutorial">BOOTSTRAP</a> <a class="w3-bar-item w3-button" href="/howto/default.asp" title="How To">HOW TO</a> <a class="w3-bar-item w3-button" href="/w3css/default.asp" title="W3.CSS Tutorial">W3.CSS</a> <a class="w3-bar-item w3-button" href="/java/default.asp" title="Java Tutorial">JAVA</a> <a class="w3-bar-item w3-button" href="/jquery/default.asp" title="jQuery Tutorial">JQUERY</a> <a class="w3-bar-item w3-button" href="/c/index.php" title="C Tutorial">C</a> <a class="w3-bar-item w3-button" href="/cpp/default.asp" title="C++ Tutorial">C++</a> <a class="w3-bar-item w3-button" href="/cs/index.php" title="C# Tutorial">C#</a> <a class="w3-bar-item w3-button" href="/r/default.asp" title="R Tutorial">R</a> <a class="w3-bar-item w3-button" href="/react/default.asp" title="React Tutorial">React</a> <a href="javascript:void(0);" class="topnav-icons fa w3-right w3-bar-item w3-button" onclick="gSearch(this)" title="Search W3Schools"></a> <a href="javascript:void(0);" class="topnav-icons fa w3-right w3-bar-item w3-button" onclick="gTra(this)" title="Translate W3Schools"></a> <!-- <a href='javascript:void(0);' class='topnav-icons fa w3-right w3-bar-item w3-button' onclick='changecodetheme(this)' title='Toggle Dark Code Examples'></a>--> <a href="javascript:void(0);" class="topnav-icons fa w3-right w3-bar-item w3-button" onmouseover="mouseoverdarkicon()" onmouseout="mouseoutofdarkicon()" onclick="changepagetheme(2)"></a> <!-- <a class="w3-bar-item w3-button w3-right" id='topnavbtn_exercises' href='javascript:void(0);' onclick='w3_open_nav("exercises")' title='Exercises'>EXERCISES <i class='fa fa-caret-down'></i><i class='fa fa-caret-up' style='display:none'></i></a> --> </div> <div id="darkmodemenu" class="ws-black" onmouseover="mouseoverdarkicon()" onmouseout="mouseoutofdarkicon()" style="top: -40px;"> <input id="radio_darkpage" type="checkbox" name="radio_theme_mode" onclick="click_darkpage()"><label for="radio_darkpage"> Dark mode</label> <br> <input id="radio_darkcode" type="checkbox" name="radio_theme_mode" onclick="click_darkcode()"><label for="radio_darkcode"> Dark code</label> </div> <nav id="nav_tutorials" class="w3-hide-small" style="position: absolute; padding-bottom: 60px; display: none;"> <div class="w3-content" style="max-width:1100px;font-size:18px"> <span onclick="w3_close_nav('tutorials')" class="w3-button w3-xxxlarge w3-display-topright w3-hover-white sectionxsclosenavspan" style="padding-right:30px;padding-left:30px;">×</span><br> <div class="w3-row-padding w3-bar-block"> <div class="w3-container" style="padding-left:13px"> <h2 style="color:#FFF4A3;"><b>Tutorials</b></h2> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top">HTML and CSS</h3> <a class="w3-bar-item w3-button" href="/html/default.asp">Learn HTML</a> <a class="w3-bar-item w3-button" href="/css/default.asp">Learn CSS</a> <a class="w3-bar-item w3-button" href="/css/css_rwd_intro.asp" title="Responsive Web Design">Learn RWD</a> <a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_ver.asp">Learn Bootstrap</a> <a class="w3-bar-item w3-button" href="/w3css/default.asp">Learn W3.CSS</a> <a class="w3-bar-item w3-button" href="/colors/default.asp">Learn Colors</a> <a class="w3-bar-item w3-button" href="/icons/default.asp">Learn Icons</a> <a class="w3-bar-item w3-button" href="/graphics/default.asp">Learn Graphics</a> <a class="w3-bar-item w3-button" href="/graphics/svg_intro.asp">Learn SVG</a> <a class="w3-bar-item w3-button" href="/graphics/canvas_intro.asp">Learn Canvas</a> <a class="w3-bar-item w3-button" href="/howto/default.asp">Learn How To</a> <a class="w3-bar-item w3-button" href="/sass/default.php">Learn Sass</a> <div class="w3-hide-large w3-hide-small"> <h3 class="w3-margin-top">Data Analytics</h3> <a class="w3-bar-item w3-button" href="/ai/default.asp">Learn AI</a> <a class="w3-bar-item w3-button" href="/python/python_ml_getting_started.asp">Learn Machine Learning</a> <a class="w3-bar-item w3-button" href="/datascience/default.asp">Learn Data Science</a> <a class="w3-bar-item w3-button" href="/python/numpy/default.asp">Learn NumPy</a> <a class="w3-bar-item w3-button" href="/python/pandas/default.asp">Learn Pandas</a> <a class="w3-bar-item w3-button" href="/python/scipy/index.php">Learn SciPy</a> <a class="w3-bar-item w3-button" href="/python/matplotlib_intro.asp">Learn Matplotlib</a> <a class="w3-bar-item w3-button" href="/statistics/index.php">Learn Statistics</a> <a class="w3-bar-item w3-button" href="/excel/index.php">Learn Excel</a> <h3 class="w3-margin-top">XML Tutorials</h3> <a class="w3-bar-item w3-button" href="/xml/default.asp">Learn XML</a> <a class="w3-bar-item w3-button" href="/xml/ajax_intro.asp">Learn XML AJAX</a> <a class="w3-bar-item w3-button" href="/xml/dom_intro.asp">Learn XML DOM</a> <a class="w3-bar-item w3-button" href="/xml/xml_dtd_intro.asp">Learn XML DTD</a> <a class="w3-bar-item w3-button" href="/xml/schema_intro.asp">Learn XML Schema</a> <a class="w3-bar-item w3-button" href="/xml/xsl_intro.asp">Learn XSLT</a> <a class="w3-bar-item w3-button" href="/xml/xpath_intro.asp">Learn XPath</a> <a class="w3-bar-item w3-button" href="/xml/xquery_intro.asp">Learn XQuery</a> </div> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top">JavaScript</h3> <a class="w3-bar-item w3-button" href="/js/default.asp">Learn JavaScript</a> <a class="w3-bar-item w3-button" href="/jquery/default.asp">Learn jQuery</a> <a class="w3-bar-item w3-button" href="/react/default.asp">Learn React</a> <a class="w3-bar-item w3-button" href="/angular/default.asp">Learn AngularJS</a> <a class="w3-bar-item w3-button" href="/js/js_json_intro.asp">Learn JSON</a> <a class="w3-bar-item w3-button" href="/js/js_ajax_intro.asp">Learn AJAX</a> <a class="w3-bar-item w3-button" href="/appml/default.asp">Learn AppML</a> <a class="w3-bar-item w3-button" href="/w3js/default.asp">Learn W3.JS</a> <h3 class="w3-margin-top">Programming</h3> <a class="w3-bar-item w3-button" href="/python/default.asp">Learn Python</a> <a class="w3-bar-item w3-button" href="/java/default.asp">Learn Java</a> <a class="w3-bar-item w3-button" href="/c/index.php">Learn C</a> <a class="w3-bar-item w3-button" href="/cpp/default.asp">Learn C++</a> <a class="w3-bar-item w3-button" href="/cs/index.php">Learn C#</a> <a class="w3-bar-item w3-button" href="/r/default.asp">Learn R</a> <a class="w3-bar-item w3-button" href="/kotlin/index.php">Learn Kotlin</a> <a class="w3-bar-item w3-button" href="/go/index.php">Learn Go</a> <a class="w3-bar-item w3-button" href="/django/index.php">Learn Django</a> <a class="w3-bar-item w3-button" href="/typescript/index.php">Learn TypeScript</a> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top">Server Side</h3> <a class="w3-bar-item w3-button" href="/sql/default.asp">Learn SQL</a> <a class="w3-bar-item w3-button" href="/mysql/default.asp">Learn MySQL</a> <a class="w3-bar-item w3-button" href="/php/default.asp">Learn PHP</a> <a class="w3-bar-item w3-button" href="/asp/default.asp">Learn ASP</a> <a class="w3-bar-item w3-button" href="/nodejs/default.asp">Learn Node.js</a> <a class="w3-bar-item w3-button" href="/nodejs/nodejs_raspberrypi.asp">Learn Raspberry Pi</a> <a class="w3-bar-item w3-button" href="/git/default.asp">Learn Git</a> <a class="w3-bar-item w3-button" href="/aws/index.php">Learn AWS Cloud</a> <h3 class="w3-margin-top">Web Building</h3> <a class="w3-bar-item w3-button" href="https://www.w3schools.com/spaces" target="_blank" onclick="ga('send', 'event', 'spacesFromTutorialsAcc', 'click');" title="Get Your Own Website With W3schools Spaces">Create a Website <span class="ribbon-topnav ws-yellow">NEW</span></a> <a class="w3-bar-item w3-button" href="/where_to_start.asp">Where To Start</a> <a class="w3-bar-item w3-button" href="/w3css/w3css_templates.asp">Web Templates</a> <a class="w3-bar-item w3-button" href="/browsers/default.asp">Web Statistics</a> <a class="w3-bar-item w3-button" href="/cert/default.asp">Web Certificates</a> <a class="w3-bar-item w3-button" href="/whatis/default.asp">Web Development</a> <a class="w3-bar-item w3-button" href="/tryit/default.asp">Code Editor</a> <a class="w3-bar-item w3-button" href="/typingspeed/default.asp">Test Your Typing Speed</a> <a class="w3-bar-item w3-button" href="/codegame/index.html" target="_blank">Play a Code Game</a> <a class="w3-bar-item w3-button" href="/cybersecurity/index.php">Cyber Security</a> <a class="w3-bar-item w3-button" href="/accessibility/index.php">Accessibility</a> </div> <div class="w3-col l3 m6 w3-hide-medium"> <h3 class="w3-margin-top">Data Analytics</h3> <a class="w3-bar-item w3-button" href="/ai/default.asp">Learn AI</a> <a class="w3-bar-item w3-button" href="/python/python_ml_getting_started.asp">Learn Machine Learning</a> <a class="w3-bar-item w3-button" href="/datascience/default.asp">Learn Data Science</a> <a class="w3-bar-item w3-button" href="/python/numpy/default.asp">Learn NumPy</a> <a class="w3-bar-item w3-button" href="/python/pandas/default.asp">Learn Pandas</a> <a class="w3-bar-item w3-button" href="/python/scipy/index.php">Learn SciPy</a> <a class="w3-bar-item w3-button" href="/python/matplotlib_intro.asp">Learn Matplotlib</a> <a class="w3-bar-item w3-button" href="/statistics/index.php">Learn Statistics</a> <a class="w3-bar-item w3-button" href="/excel/index.php">Learn Excel</a> <a class="w3-bar-item w3-button" href="/googlesheets/index.php">Learn Google Sheets</a> <h3 class="w3-margin-top">XML Tutorials</h3> <a class="w3-bar-item w3-button" href="/xml/default.asp">Learn XML</a> <a class="w3-bar-item w3-button" href="/xml/ajax_intro.asp">Learn XML AJAX</a> <a class="w3-bar-item w3-button" href="/xml/dom_intro.asp">Learn XML DOM</a> <a class="w3-bar-item w3-button" href="/xml/xml_dtd_intro.asp">Learn XML DTD</a> <a class="w3-bar-item w3-button" href="/xml/schema_intro.asp">Learn XML Schema</a> <a class="w3-bar-item w3-button" href="/xml/xsl_intro.asp">Learn XSLT</a> <a class="w3-bar-item w3-button" href="/xml/xpath_intro.asp">Learn XPath</a> <a class="w3-bar-item w3-button" href="/xml/xquery_intro.asp">Learn XQuery</a> </div> </div> </div> <br class="hidesm"> </nav> <nav id="nav_references" class="w3-hide-small" style="position: absolute; padding-bottom: 60px; display: none;"> <div class="w3-content" style="max-width:1100px;font-size:18px"> <span onclick="w3_close_nav('references')" class="w3-button w3-xxxlarge w3-display-topright w3-hover-white sectionxsclosenavspan" style="padding-right:30px;padding-left:30px;">×</span><br> <div class="w3-row-padding w3-bar-block"> <div class="w3-container" style="padding-left:13px"> <h2 style="color:#FFF4A3;"><b>References</b></h2> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top">HTML</h3> <a class="w3-bar-item w3-button" href="/tags/default.asp">HTML Tag Reference</a> <a class="w3-bar-item w3-button" href="/tags/ref_html_browsersupport.asp">HTML Browser Support</a> <a class="w3-bar-item w3-button" href="/tags/ref_eventattributes.asp">HTML Event Reference</a> <a class="w3-bar-item w3-button" href="/colors/default.asp">HTML Color Reference</a> <a class="w3-bar-item w3-button" href="/tags/ref_attributes.asp">HTML Attribute Reference</a> <a class="w3-bar-item w3-button" href="/tags/ref_canvas.asp">HTML Canvas Reference</a> <a class="w3-bar-item w3-button" href="/graphics/svg_reference.asp">HTML SVG Reference</a> <a class="w3-bar-item w3-button" href="/graphics/google_maps_reference.asp">Google Maps Reference</a> <h3 class="w3-margin-top">CSS</h3> <a class="w3-bar-item w3-button" href="/cssref/default.asp">CSS Reference</a> <a class="w3-bar-item w3-button" href="/cssref/css3_browsersupport.asp">CSS Browser Support</a> <a class="w3-bar-item w3-button" href="/cssref/css_selectors.asp">CSS Selector Reference</a> <a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_ref_all_classes.asp">Bootstrap 3 Reference</a> <a class="w3-bar-item w3-button" href="/bootstrap4/bootstrap_ref_all_classes.asp">Bootstrap 4 Reference</a> <a class="w3-bar-item w3-button" href="/w3css/w3css_references.asp">W3.CSS Reference</a> <a class="w3-bar-item w3-button" href="/icons/icons_reference.asp">Icon Reference</a> <a class="w3-bar-item w3-button" href="/sass/sass_functions_string.php">Sass Reference</a> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top">JavaScript</h3> <a class="w3-bar-item w3-button" href="/jsref/default.asp">JavaScript Reference</a> <a class="w3-bar-item w3-button" href="/jsref/default.asp">HTML DOM Reference</a> <a class="w3-bar-item w3-button" href="/jquery/jquery_ref_overview.asp">jQuery Reference</a> <a class="w3-bar-item w3-button" href="/angular/angular_ref_directives.asp">AngularJS Reference</a> <a class="w3-bar-item w3-button" href="/appml/appml_reference.asp">AppML Reference</a> <a class="w3-bar-item w3-button" href="/w3js/w3js_references.asp">W3.JS Reference</a> <h3 class="w3-margin-top">Programming</h3> <a class="w3-bar-item w3-button" href="/python/python_reference.asp">Python Reference</a> <a class="w3-bar-item w3-button" href="/java/java_ref_keywords.asp">Java Reference</a> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top">Server Side</h3> <a class="w3-bar-item w3-button" href="/sql/sql_ref_keywords.asp">SQL Reference</a> <a class="w3-bar-item w3-button" href="/mysql/mysql_ref_functions.asp">MySQL Reference</a> <a class="w3-bar-item w3-button" href="/php/php_ref_overview.asp">PHP Reference</a> <a class="w3-bar-item w3-button" href="/asp/asp_ref_response.asp">ASP Reference</a> <h3 class="w3-margin-top">XML</h3> <a class="w3-bar-item w3-button" href="/xml/dom_nodetype.asp">XML DOM Reference</a> <a class="w3-bar-item w3-button" href="/xml/dom_http.asp">XML Http Reference</a> <a class="w3-bar-item w3-button" href="/xml/xsl_elementref.asp">XSLT Reference</a> <a class="w3-bar-item w3-button" href="/xml/schema_elements_ref.asp">XML Schema Reference</a> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top">Character Sets</h3> <a class="w3-bar-item w3-button" href="/charsets/default.asp">HTML Character Sets</a> <a class="w3-bar-item w3-button" href="/charsets/ref_html_ascii.asp">HTML ASCII</a> <a class="w3-bar-item w3-button" href="/charsets/ref_html_ansi.asp">HTML ANSI</a> <a class="w3-bar-item w3-button" href="/charsets/ref_html_ansi.asp">HTML Windows-1252</a> <a class="w3-bar-item w3-button" href="/charsets/ref_html_8859.asp">HTML ISO-8859-1</a> <a class="w3-bar-item w3-button" href="/charsets/ref_html_symbols.asp">HTML Symbols</a> <a class="w3-bar-item w3-button" href="/charsets/ref_html_utf8.asp">HTML UTF-8</a> </div> </div> <br class="hidesm"> </div> </nav> <nav id="nav_exercises" class="w3-hide-small" style="position: absolute; padding-bottom: 60px; display: none;"> <div class="w3-content" style="max-width:1100px;font-size:18px"> <span onclick="w3_close_nav('exercises')" class="w3-button w3-xxxlarge w3-display-topright w3-hover-white sectionxsclosenavspan" style="padding-right:30px;padding-left:30px;">×</span><br> <div class="w3-row-padding w3-bar-block"> <div class="w3-container" style="padding-left:13px"> <h2 style="color:#FFF4A3;"><b>Exercises and Quizzes</b></h2> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top"><a class="ws-btn ws-yellow w3-hover-text-white" style="width:155px;font-size:21px" href="/exercises/index.php">Exercises</a></h3> <a class="w3-bar-item w3-button" href="/html/html_exercises.asp">HTML Exercises</a> <a class="w3-bar-item w3-button" href="/css/css_exercises.asp">CSS Exercises</a> <a class="w3-bar-item w3-button" href="/js/js_exercises.asp">JavaScript Exercises</a> <a class="w3-bar-item w3-button" href="/sql/sql_exercises.asp">SQL Exercises</a> <a class="w3-bar-item w3-button" href="/mysql/mysql_exercises.asp">MySQL Exercises</a> <a class="w3-bar-item w3-button" href="/php/php_exercises.asp">PHP Exercises</a> <a class="w3-bar-item w3-button" href="/python/python_exercises.asp">Python Exercises</a> <a class="w3-bar-item w3-button" href="/python/numpy/numpy_exercises.asp">NumPy Exercises</a> <a class="w3-bar-item w3-button" href="/python/pandas/pandas_exercises.asp">Pandas Exercises</a> <a class="w3-bar-item w3-button" href="/python/scipy/scipy_exercises.php">SciPy Exercises</a> <a class="w3-bar-item w3-button" href="/jquery/jquery_exercises.asp">jQuery Exercises</a> <a class="w3-bar-item w3-button" href="/java/java_exercises.asp">Java Exercises</a> <a class="w3-bar-item w3-button" href="/cpp/cpp_exercises.asp">C++ Exercises</a> <a class="w3-bar-item w3-button" href="/cs/cs_exercises.asp">C# Exercises</a> <a class="w3-bar-item w3-button" href="/r/r_exercises.asp">R Exercises</a> <a class="w3-bar-item w3-button" href="/kotlin/kotlin_exercises.php">Kotlin Exercises</a> <a class="w3-bar-item w3-button" href="/go/go_exercises.php">Go Exercises</a> <a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_exercises.asp">Bootstrap Exercises</a> <a class="w3-bar-item w3-button" href="/bootstrap4/bootstrap_exercises.asp">Bootstrap 4 Exercises</a> <a class="w3-bar-item w3-button" href="/bootstrap5/bootstrap_exercises.php">Bootstrap 5 Exercises</a> <a class="w3-bar-item w3-button" href="/git/git_exercises.asp">Git Exercises</a> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top"><a class="ws-btn ws-yellow w3-hover-text-white" style="width:135px;font-size:21px" href="/quiztest/default.asp">Quizzes</a></h3> <a class="w3-bar-item w3-button" href="/html/html_quiz.asp" target="_top">HTML Quiz</a> <a class="w3-bar-item w3-button" href="/css/css_quiz.asp" target="_top">CSS Quiz</a> <a class="w3-bar-item w3-button" href="/js/js_quiz.asp" target="_top">JavaScript Quiz</a> <a class="w3-bar-item w3-button" href="/sql/sql_quiz.asp" target="_top">SQL Quiz</a> <a class="w3-bar-item w3-button" href="/mysql/mysql_quiz.asp" target="_top">MySQL Quiz</a> <a class="w3-bar-item w3-button" href="/php/php_quiz.asp" target="_top">PHP Quiz</a> <a class="w3-bar-item w3-button" href="/python/python_quiz.asp" target="_top">Python Quiz</a> <a class="w3-bar-item w3-button" href="/python/numpy/numpy_quiz.asp" target="_top">NumPy Quiz</a> <a class="w3-bar-item w3-button" href="/python/pandas/pandas_quiz.asp" target="_top">Pandas Quiz</a> <a class="w3-bar-item w3-button" href="/python/scipy/scipy_quiz.php" target="_top">SciPy Quiz</a> <a class="w3-bar-item w3-button" href="/jquery/jquery_quiz.asp" target="_top">jQuery Quiz</a> <a class="w3-bar-item w3-button" href="/java/java_quiz.asp" target="_top">Java Quiz</a> <a class="w3-bar-item w3-button" href="/cpp/cpp_quiz.asp" target="_top">C++ Quiz</a> <a class="w3-bar-item w3-button" href="/cs/cs_quiz.asp" target="_top">C# Quiz</a> <a class="w3-bar-item w3-button" href="/r/r_quiz.asp" target="_top">R Quiz</a> <a class="w3-bar-item w3-button" href="/kotlin/kotlin_quiz.php" target="_top">Kotlin Quiz</a> <a class="w3-bar-item w3-button" href="/xml/xml_quiz.asp" target="_top">XML Quiz</a> <a class="w3-bar-item w3-button" href="/bootstrap/bootstrap_quiz.asp" target="_top">Bootstrap Quiz</a> <a class="w3-bar-item w3-button" href="/bootstrap4/bootstrap_quiz.asp" target="_top">Bootstrap 4 Quiz</a> <a class="w3-bar-item w3-button" href="/bootstrap5/bootstrap_quiz.php" target="_top">Bootstrap 5 Quiz</a> <a class="w3-bar-item w3-button" href="/cybersecurity/cybersecurity_quiz.php">Cyber Security Quiz</a> <a class="w3-bar-item w3-button" href="/accessibility/accessibility_quiz.php">Accessibility Quiz</a> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top"><a class="ws-btn ws-yellow w3-hover-text-white" style="width:135px;font-size:21px" href="https://courses.w3schools.com/" target="_blank">Courses</a></h3> <!-- cert <a class="w3-bar-item w3-button" href="/cert/cert_html_new.asp" target="_top">HTML Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_css.asp" target="_top">CSS Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_javascript.asp" target="_top">JavaScript Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_sql.asp" target="_top">SQL Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_php.asp" target="_top">PHP Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_python.asp" target="_top">Python Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_bootstrap.asp" target="_top">Bootstrap Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_jquery.asp" target="_top">jQuery Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_xml.asp" target="_top">XML Certificate</a> --> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/html" target="_blank">HTML Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/css" target="_blank">CSS Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/javascript" target="_blank">JavaScript Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/programs/front-end" target="_blank">Front End Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/sql" target="_blank">SQL Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/php" target="_blank">PHP Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/python" target="_blank">Python Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/numpy-fundamentals" target="_blank">NumPy Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/pandas-fundamentals" target="_blank">Pandas Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/programs/data-analytics" target="_blank">Data Analytics Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/jquery" target="_blank">jQuery Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/java" target="_blank">Java Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/cplusplus" target="_blank">C++ Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/c-sharp" target="_blank">C# Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/r-fundamentals" target="_blank">R Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/xml" target="_blank">XML Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/introduction-to-cyber-security" target="_blank">Cyber Security Course</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/courses/accessibility-fundamentals" target="_blank">Accessibility Course</a> </div> <div class="w3-col l3 m6"> <h3 class="w3-margin-top"><a class="ws-btn ws-yellow w3-hover-text-white" style="width:150px;font-size:21px" href="https://courses.w3schools.com/browse/certifications" target="_blank">Certificates</a></h3> <!-- cert <a class="w3-bar-item w3-button" href="/cert/cert_html_new.asp" target="_top">HTML Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_css.asp" target="_top">CSS Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_javascript.asp" target="_top">JavaScript Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_sql.asp" target="_top">SQL Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_php.asp" target="_top">PHP Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_python.asp" target="_top">Python Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_bootstrap.asp" target="_top">Bootstrap Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_jquery.asp" target="_top">jQuery Certificate</a> <a class="w3-bar-item w3-button" href="/cert/cert_xml.asp" target="_top">XML Certificate</a> --> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/html-certification-exam" target="_blank">HTML Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/css-certification-exam" target="_blank">CSS Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/javascript-certification-exam" target="_blank">JavaScript Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/front-end-certification-exam" target="_blank">Front End Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/sql-certification-exam" target="_blank">SQL Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/php-certification-exam" target="_blank">PHP Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/python-certificaftion-exam" target="_blank">Python Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/data-science-certification-exam" target="_blank">Data Science Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/bootstrap-3-certification-exam" target="_blank">Bootstrap 3 Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/bootstrap-4-certification-exam" target="_blank">Bootstrap 4 Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/jquery-certification-exam" target="_blank">jQuery Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/java-certification-exam" target="_blank">Java Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/c-certification-exam" target="_blank">C++ Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/react-certification-exam" target="_blank">React Certificate</a> <a class="w3-bar-item w3-button" href="https://courses.w3schools.com/browse/certifications/courses/xml-certification-exam" target="_blank">XML Certificate</a> </div> </div> <br class="hidesm"> </div> </nav> </div> </div> <div id="myAccordion" class="w3-card-2 w3-center w3-hide-large w3-hide-medium ws-grey" style="width: 100%; position: absolute; display: none; padding-top: 44px;"> <a href="javascript:void(0)" onclick="w3_close()" class="w3-button w3-xxlarge w3-right">×</a><br> <div class="w3-container w3-padding-32"> <a class="w3-button w3-block" style="font-size:22px;" onclick="open_xs_menu('tutorials');" href="javascript:void(0);">Tutorials <i class="fa fa-caret-down"></i></a> <div id="sectionxs_tutorials" class="w3-left-align w3-show" style="background-color:#282A35;color:white;"></div> <a class="w3-button w3-block" style="font-size:22px;" onclick="open_xs_menu('references')" href="javascript:void(0);">References <i class="fa fa-caret-down"></i></a> <div id="sectionxs_references" class="w3-left-align w3-show" style="background-color:#282A35;color:white;"></div> <a class="w3-button w3-block" style="font-size:22px;" onclick="open_xs_menu('exercises')" href="javascript:void(0);">Exercises <i class="fa fa-caret-down"></i></a> <div id="sectionxs_exercises" class="w3-left-align w3-show" style="background-color:#282A35;color:white;"></div> <a class="w3-button w3-block" style="font-size:22px;" href="/cert/default.asp" target="_blank">Paid Courses</a> <a class="w3-button w3-block" style="font-size:22px;" href="https://www.w3schools.com/spaces" target="_blank" onclick="ga('send', 'event', 'spacesFromTutorialsAcc', 'click');" title="Get Your Own Website With W3schools Spaces">Spaces</a> <a class="w3-button w3-block" style="font-size:22px;" target="_blank" href="https://www.w3schools.com/videos/index.php" onclick="ga('send', 'event', 'Videos' , 'fromTopnavMain')" title="Video Tutorials">Videos</a> <a class="w3-button w3-block" style="font-size:22px;" href="https://shop.w3schools.com" target="_blank">Shop</a> <a class="w3-button w3-block" style="font-size:22px;" href="/pro/index.php">Pro</a> </div> </div> <script> ( function setThemeCheckboxes() { var x = localStorage.getItem("preferredmode"); var y = localStorage.getItem("preferredpagemode"); if (x == "dark") { document.getElementById("radio_darkcode").checked = true; } if (y == "dark") { document.getElementById("radio_darkpage").checked = true; } })(); function mouseoverdarkicon() { if(window.matchMedia("(pointer: coarse)").matches) { return false; } var a = document.getElementById("darkmodemenu"); a.style.top = "44px"; } function mouseoutofdarkicon() { var a = document.getElementById("darkmodemenu"); a.style.top = "-40px"; } function changepagetheme(n) { var a = document.getElementById("radio_darkcode"); var b = document.getElementById("radio_darkpage"); document.body.className = document.body.className.replace("darktheme", ""); document.body.className = document.body.className.replace("darkpagetheme", ""); document.body.className = document.body.className.replace(" ", " "); if (a.checked && b.checked) { localStorage.setItem("preferredmode", "light"); localStorage.setItem("preferredpagemode", "light"); a.checked = false; b.checked = false; } else { document.body.className += " darktheme"; document.body.className += " darkpagetheme"; localStorage.setItem("preferredmode", "dark"); localStorage.setItem("preferredpagemode", "dark"); a.checked = true; b.checked = true; } } function click_darkpage() { var b = document.getElementById("radio_darkpage"); if (b.checked) { document.body.className += " darkpagetheme"; document.body.className = document.body.className.replace(" ", " "); localStorage.setItem("preferredpagemode", "dark"); } else { document.body.className = document.body.className.replace("darkpagetheme", ""); document.body.className = document.body.className.replace(" ", " "); localStorage.setItem("preferredpagemode", "light"); } } function click_darkcode() { var a = document.getElementById("radio_darkcode"); if (a.checked) { document.body.className += " darktheme"; document.body.className = document.body.className.replace(" ", " "); localStorage.setItem("preferredmode", "dark"); } else { document.body.className = document.body.className.replace("darktheme", ""); document.body.className = document.body.className.replace(" ", " "); localStorage.setItem("preferredmode", "light"); } } </script> <div class="w3-sidebar w3-collapse" id="sidenav" style="top: 44px; display: none;"> <div id="leftmenuinner" style="padding-top: 44px;"> <div id="leftmenuinnerinner"> <!-- <a href='javascript:void(0)' onclick='close_menu()' class='w3-button w3-hide-large w3-large w3-display-topright' style='right:16px;padding:3px 12px;font-weight:bold;'>×</a>--> <h2 class="left"><span class="left_h2">HTML</span> Reference</h2> <a target="_top" href="default.asp">HTML by Alphabet</a> <a target="_top" href="ref_byfunc.asp">HTML by Category</a> <a target="_top" href="ref_html_browsersupport.asp">HTML Browser Support</a> <a target="_top" href="ref_attributes.asp">HTML Attributes</a> <a target="_top" href="ref_standardattributes.asp">HTML Global Attributes</a> <a target="_top" href="ref_eventattributes.asp">HTML Events</a> <a target="_top" href="ref_colornames.asp">HTML Colors</a> <a target="_top" href="ref_canvas.asp">HTML Canvas</a> <a target="_top" href="ref_av_dom.asp">HTML Audio/Video</a> <a target="_top" href="ref_charactersets.asp">HTML Character Sets</a> <a target="_top" href="ref_html_dtd.asp">HTML Doctypes</a> <a target="_top" href="ref_urlencode.asp">HTML URL Encode</a> <a target="_top" href="ref_language_codes.asp">HTML Language Codes</a> <a target="_top" href="ref_country_codes.asp">HTML Country Codes</a> <a target="_top" href="ref_httpmessages.asp">HTTP Messages</a> <a target="_top" href="ref_httpmethods.asp">HTTP Methods</a> <a target="_top" href="ref_pxtoemconversion.asp">PX to EM Converter</a> <a target="_top" href="ref_keyboardshortcuts.asp">Keyboard Shortcuts</a> <br> <div class="notranslate"> <h2 class="left"><span class="left_h2">HTML</span> Tags</h2> <a target="_top" href="tag_comment.asp"><!--></a> <a target="_top" href="tag_doctype.asp"><!DOCTYPE></a> <a target="_top" href="tag_a.asp"><a></a> <a target="_top" href="tag_abbr.asp"><abbr></a> <a target="_top" href="tag_acronym.asp"><acronym></a> <a target="_top" href="tag_address.asp"><address></a> <a target="_top" href="tag_applet.asp"><applet></a> <a target="_top" href="tag_area.asp"><area></a> <a target="_top" href="tag_article.asp"><article></a> <a target="_top" href="tag_aside.asp"><aside></a> <a target="_top" href="tag_audio.asp"><audio></a> <a target="_top" href="tag_b.asp"><b></a> <a target="_top" href="tag_base.asp"><base></a> <a target="_top" href="tag_basefont.asp"><basefont></a> <a target="_top" href="tag_bdi.asp"><bdi></a> <a target="_top" href="tag_bdo.asp"><bdo></a> <a target="_top" href="tag_big.asp"><big></a> <a target="_top" href="tag_blockquote.asp"><blockquote></a> <a target="_top" href="tag_body.asp"><body></a> <a target="_top" href="tag_br.asp"><br></a> <a target="_top" href="tag_button.asp"><button></a> <a target="_top" href="tag_canvas.asp"><canvas></a> <a target="_top" href="tag_caption.asp"><caption></a> <a target="_top" href="tag_center.asp"><center></a> <a target="_top" href="tag_cite.asp"><cite></a> <a target="_top" href="tag_code.asp"><code></a> <a target="_top" href="tag_col.asp"><col></a> <a target="_top" href="tag_colgroup.asp"><colgroup></a> <a target="_top" href="tag_data.asp"><data></a> <a target="_top" href="tag_datalist.asp"><datalist></a> <a target="_top" href="tag_dd.asp"><dd></a> <a target="_top" href="tag_del.asp"><del></a> <a target="_top" href="tag_details.asp"><details></a> <a target="_top" href="tag_dfn.asp"><dfn></a> <a target="_top" href="tag_dialog.asp"><dialog></a> <a target="_top" href="tag_dir.asp"><dir></a> <a target="_top" href="tag_div.asp"><div></a> <a target="_top" href="tag_dl.asp"><dl></a> <a target="_top" href="tag_dt.asp"><dt></a> <a target="_top" href="tag_em.asp"><em></a> <a target="_top" href="tag_embed.asp"><embed></a> <a target="_top" href="tag_fieldset.asp"><fieldset></a> <a target="_top" href="tag_figcaption.asp"><figcaption></a> <a target="_top" href="tag_figure.asp"><figure></a> <a target="_top" href="tag_font.asp"><font></a> <a target="_top" href="tag_footer.asp"><footer></a> <a target="_top" href="tag_form.asp"><form></a> <a target="_top" href="tag_frame.asp"><frame></a> <a target="_top" href="tag_frameset.asp"><frameset></a> <a target="_top" href="tag_hn.asp"><h1> - <h6></a> <a target="_top" href="tag_head.asp"><head></a> <a target="_top" href="tag_header.asp"><header></a> <a target="_top" href="tag_hr.asp"><hr></a> <a target="_top" href="tag_html.asp"><html></a> <a target="_top" href="tag_i.asp"><i></a> <a target="_top" href="tag_iframe.asp"><iframe></a> <a target="_top" href="tag_img.asp"><img></a> <a target="_top" href="tag_input.asp"><input></a> <a target="_top" href="tag_ins.asp"><ins></a> <a target="_top" href="tag_kbd.asp"><kbd></a> <a target="_top" href="tag_label.asp"><label></a> <a target="_top" href="tag_legend.asp"><legend></a> <a target="_top" href="tag_li.asp"><li></a> <a target="_top" href="tag_link.asp"><link></a> <a target="_top" href="tag_main.asp"><main></a> <a target="_top" href="tag_map.asp"><map></a> <a target="_top" href="tag_mark.asp"><mark></a> <a target="_top" href="tag_meta.asp"><meta></a> <a target="_top" href="tag_meter.asp"><meter></a> <a target="_top" href="tag_nav.asp"><nav></a> <a target="_top" href="tag_noframes.asp"><noframes></a> <a target="_top" href="tag_noscript.asp"><noscript></a> <a target="_top" href="tag_object.asp"><object></a> <a target="_top" href="tag_ol.asp"><ol></a> <a target="_top" href="tag_optgroup.asp"><optgroup></a> <a target="_top" href="tag_option.asp"><option></a> <a target="_top" href="tag_output.asp"><output></a> <a target="_top" href="tag_p.asp" class="active"><p></a> <a target="_top" href="tag_param.asp"><param></a> <a target="_top" href="tag_picture.asp"><picture></a> <a target="_top" href="tag_pre.asp"><pre></a> <a target="_top" href="tag_progress.asp"><progress></a> <a target="_top" href="tag_q.asp"><q></a> <a target="_top" href="tag_rp.asp"><rp></a> <a target="_top" href="tag_rt.asp"><rt></a> <a target="_top" href="tag_ruby.asp"><ruby></a> <a target="_top" href="tag_s.asp"><s></a> <a target="_top" href="tag_samp.asp"><samp></a> <a target="_top" href="tag_script.asp"><script></a> <a target="_top" href="tag_section.asp"><section></a> <a target="_top" href="tag_select.asp"><select></a> <a target="_top" href="tag_small.asp"><small></a> <a target="_top" href="tag_source.asp"><source></a> <a target="_top" href="tag_span.asp"><span></a> <a target="_top" href="tag_strike.asp"><strike></a> <a target="_top" href="tag_strong.asp"><strong></a> <a target="_top" href="tag_style.asp"><style></a> <a target="_top" href="tag_sub.asp"><sub></a> <a target="_top" href="tag_summary.asp"><summary></a> <a target="_top" href="tag_sup.asp"><sup></a> <a target="_top" href="tag_svg.asp"><svg></a> <a target="_top" href="tag_table.asp"><table></a> <a target="_top" href="tag_tbody.asp"><tbody></a> <a target="_top" href="tag_td.asp"><td></a> <a target="_top" href="tag_template.asp"><template></a> <a target="_top" href="tag_textarea.asp"><textarea></a> <a target="_top" href="tag_tfoot.asp"><tfoot></a> <a target="_top" href="tag_th.asp"><th></a> <a target="_top" href="tag_thead.asp"><thead></a> <a target="_top" href="tag_time.asp"><time></a> <a target="_top" href="tag_title.asp"><title></a> <a target="_top" href="tag_tr.asp"><tr></a> <a target="_top" href="tag_track.asp"><track></a> <a target="_top" href="tag_tt.asp"><tt></a> <a target="_top" href="tag_u.asp"><u></a> <a target="_top" href="tag_ul.asp"><ul></a> <a target="_top" href="tag_var.asp"><var></a> <a target="_top" href="tag_video.asp"><video></a> <a target="_top" href="tag_wbr.asp"><wbr></a> </div> <br><br> </div> </div> </div> <div class="w3-main w3-light-grey" id="belowtopnav" style="margin-left: 220px; padding-top: 44px;"> <div class="w3-row w3-white"> <div class="w3-col l10 m12" id="main"> <div id="mainLeaderboard" style="overflow:hidden;"> <!-- MainLeaderboard--> <!--<pre>main_leaderboard, all: [728,90][970,90][320,50][468,60]</pre>--> <div id="adngin-main_leaderboard-0" data-google-query-id="CJPA_sueqvcCFXiOSwUd2fYBLg"><div id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//main_leaderboard_1__container__" style="border: 0pt none;"><iframe id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//main_leaderboard_1" name="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//main_leaderboard_1" title="3rd party ad content" width="728" height="90" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" role="region" aria-label="Advertisement" tabindex="0" srcdoc="" data-google-container-id="7" style="border: 0px; vertical-align: bottom;" data-load-complete="true"><div style="position: absolute; width: 0px; height: 0px; border: 0px; padding: 0px; margin: 0px; overflow: hidden;"><button></button><a href="https://yahoo.com"></a><input></div></iframe></div></div> <!-- adspace leaderboard --> </div> <h1>HTML <span class="color_h1"><p></span> Tag</h1> <div class="w3-clear w3-center nextprev"> <a class="w3-left w3-btn" href="tag_output.asp">❮<span class="w3-hide-small"> Previous</span></a> <a class="w3-btn" href="default.asp"><span class="w3-hide-small">Complete HTML </span>Reference</a> <a class="w3-right w3-btn" href="tag_param.asp"><span class="w3-hide-small">Next </span>❯</a> </div> <br> <div class="w3-example"> <h3>Example</h3> <p>A paragraph is marked up as follows:</p> <div class="w3-code notranslate htmlHigh"> <span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>p<span class="tagcolor" style="color:mediumblue">></span></span>This is some text in a paragraph.<span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>/p<span class="tagcolor" style="color:mediumblue">></span></span> </div> <a target="_blank" href="tryit.asp?filename=tryhtml_paragraphs1" class="w3-btn w3-margin-bottom">Try it Yourself »</a> </div> <p>More "Try it Yourself" examples below.</p> <hr> <h2>Definition and Usage</h2> <p>The <code class="w3-codespan"><p></code> tag defines a paragraph.</p> <p>Browsers automatically add a single blank line before and after each <code class="w3-codespan"><p></code> element.</p> <p><strong>Tip:</strong> Use CSS to <a href="/html/html_css.asp">style paragraphs</a>.</p> <hr> <h2>Browser Support</h2> <table class="browserref notranslate"> <tbody><tr> <th style="width:20%;font-size:16px;text-align:left;">Element</th> <th style="width:16%;" class="bsChrome" title="Chrome"></th> <th style="width:16%;" class="bsEdge" title="Internet Explorer / Edge"></th> <th style="width:16%;" class="bsFirefox" title="Firefox"></th> <th style="width:16%;" class="bsSafari" title="Safari"></th> <th style="width:16%;" class="bsOpera" title="Opera"></th> </tr><tr> <td style="text-align:left;"><p></td> <td>Yes</td> <td>Yes</td> <td>Yes</td> <td>Yes</td> <td>Yes</td> </tr> </tbody></table> <hr> <h2>Global Attributes</h2> <p>The <code class="w3-codespan"><p></code> tag also supports the <a href="ref_standardattributes.asp">Global Attributes in HTML</a>.</p> <hr> <h2>Event Attributes</h2> <p>The <code class="w3-codespan"><p></code> tag also supports the <a href="ref_eventattributes.asp">Event Attributes in HTML</a>.</p> <hr> <div id="midcontentadcontainer" style="overflow:auto;text-align:center"> <!-- MidContent --> <!-- <p class="adtext">Advertisement</p> --> <div id="adngin-mid_content-0" data-google-query-id="CKfs_8ueqvcCFXiOSwUd2fYBLg"><div id="sn_ad_label_adngin-mid_content-0" class="sn_ad_label" style="color:#000000;font-size:12px;margin:0;text-align:center;">ADVERTISEMENT</div><div id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//mid_content_1__container__" style="border: 0pt none; display: inline-block; width: 300px; height: 250px;"><iframe frameborder="0" src="https://56d0da6c34aaa471db22bb4266aac656.safeframe.googlesyndication.com/safeframe/1-0-38/html/container.html" id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//mid_content_1" title="3rd party ad content" name="" scrolling="no" marginwidth="0" marginheight="0" width="300" height="250" data-is-safeframe="true" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" role="region" aria-label="Advertisement" tabindex="0" data-google-container-id="8" style="border: 0px; vertical-align: bottom;" data-load-complete="true"></iframe></div></div> </div> <hr> <h2>More Examples</h2> <div class="w3-example"> <h3>Example</h3> <p>Align text in a paragraph (with CSS):</p> <div class="w3-code notranslate htmlHigh"> <span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>p<span class="attributecolor" style="color:red"> style<span class="attributevaluecolor" style="color:mediumblue">="text-align:right"</span></span><span class="tagcolor" style="color:mediumblue">></span></span>This is some text in a paragraph.<span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>/p<span class="tagcolor" style="color:mediumblue">></span></span> </div> <a target="_blank" href="tryit.asp?filename=tryhtml_p_align_css" class="w3-btn w3-margin-bottom">Try it Yourself »</a> </div> <div class="w3-example"> <h3>Example</h3> <p>Style paragraphs with CSS:</p> <div class="w3-code notranslate htmlHigh"> <span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>html<span class="tagcolor" style="color:mediumblue">></span></span><br><span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>head<span class="tagcolor" style="color:mediumblue">></span></span><br><span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>style<span class="tagcolor" style="color:mediumblue">></span></span><span class="cssselectorcolor" style="color:brown"><br>p <span class="cssdelimitercolor" style="color:black">{</span><span class="csspropertycolor" style="color:red"><br> color<span class="csspropertyvaluecolor" style="color:mediumblue"><span class="cssdelimitercolor" style="color:black">:</span> navy<span class="cssdelimitercolor" style="color:black">;</span></span><br> text-indent<span class="csspropertyvaluecolor" style="color:mediumblue"><span class="cssdelimitercolor" style="color:black">:</span> 30px<span class="cssdelimitercolor" style="color:black">;</span></span><br> text-transform<span class="csspropertyvaluecolor" style="color:mediumblue"><span class="cssdelimitercolor" style="color:black">:</span> uppercase<span class="cssdelimitercolor" style="color:black">;</span></span><br></span><span class="cssdelimitercolor" style="color:black">}</span><br></span><span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>/style<span class="tagcolor" style="color:mediumblue">></span></span><br> <span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>/head<span class="tagcolor" style="color:mediumblue">></span></span><br><span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>body<span class="tagcolor" style="color:mediumblue">></span></span><br><br><span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>p<span class="tagcolor" style="color:mediumblue">></span></span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>/p<span class="tagcolor" style="color:mediumblue">></span></span><br><br><span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>/body<span class="tagcolor" style="color:mediumblue">></span></span><br><span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>/html<span class="tagcolor" style="color:mediumblue">></span></span> </div> <a target="_blank" href="tryit.asp?filename=tryhtml_p_style_css" class="w3-btn w3-margin-bottom">Try it Yourself »</a> </div> <div class="w3-example"> <h3>Example</h3> <p> More on paragraphs:</p> <div class="w3-code notranslate htmlHigh"> <span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>p<span class="tagcolor" style="color:mediumblue">></span></span><br>This paragraph<br>contains a lot of lines<br>in the source code,<br> but the browser <br>ignores it.<br><span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>/p<span class="tagcolor" style="color:mediumblue">></span></span> </div> <a target="_blank" href="tryit.asp?filename=tryhtml_paragraphs2" class="w3-btn w3-margin-bottom">Try it Yourself »</a> </div> <div class="w3-example"> <h3>Example</h3> <p>Poem problems in HTML:</p> <div class="w3-code notranslate htmlHigh"> <span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>p<span class="tagcolor" style="color:mediumblue">></span></span><br>My Bonnie lies over the ocean.<br>My Bonnie lies over the sea.<br>My Bonnie lies over the ocean.<br>Oh, bring back my Bonnie to me.<br><span class="tagnamecolor" style="color:brown"><span class="tagcolor" style="color:mediumblue"><</span>/p<span class="tagcolor" style="color:mediumblue">></span></span> </div> <a target="_blank" href="tryit.asp?filename=tryhtml_poem" class="w3-btn w3-margin-bottom">Try it Yourself »</a> </div> <hr> <h2>Related Pages</h2> <p>HTML tutorial: <a href="/html/html_paragraphs.asp">HTML Paragraphs</a></p> <p>HTML DOM reference: <a href="/jsref/dom_obj_paragraph.asp">Paragraph Object</a></p> <hr> <h2>Default CSS Settings</h2> <p>Most browsers will display the <code class="w3-codespan"><p></code> element with the following default values:</p> <div class="w3-example"> <h3>Example</h3> <div class="w3-code notranslate cssHigh"><span class="cssselectorcolor" style="color:brown"> p <span class="cssdelimitercolor" style="color:black">{</span><span class="csspropertycolor" style="color:red"><br> display<span class="csspropertyvaluecolor" style="color:mediumblue"><span class="cssdelimitercolor" style="color:black">:</span> block<span class="cssdelimitercolor" style="color:black">;</span></span><br> margin-top<span class="csspropertyvaluecolor" style="color:mediumblue"><span class="cssdelimitercolor" style="color:black">:</span> 1em<span class="cssdelimitercolor" style="color:black">;</span></span><br> margin-bottom<span class="csspropertyvaluecolor" style="color:mediumblue"><span class="cssdelimitercolor" style="color:black">:</span> 1em<span class="cssdelimitercolor" style="color:black">;</span></span><br> margin-left<span class="csspropertyvaluecolor" style="color:mediumblue"><span class="cssdelimitercolor" style="color:black">:</span> 0<span class="cssdelimitercolor" style="color:black">;</span></span><br> margin-right<span class="csspropertyvaluecolor" style="color:mediumblue"><span class="cssdelimitercolor" style="color:black">:</span> 0<span class="cssdelimitercolor" style="color:black">;</span></span><br></span><span class="cssdelimitercolor" style="color:black">}</span> </span></div> <a target="_blank" href="tryit.asp?filename=tryhtml_p_default_css" class="w3-btn w3-margin-bottom">Try it Yourself »</a> </div> <br> <br> <div class="w3-clear w3-center nextprev"> <a class="w3-left w3-btn" href="tag_output.asp">❮<span class="w3-hide-small"> Previous</span></a> <a class="w3-btn" href="default.asp"><span class="w3-hide-small">Complete HTML </span>Reference</a> <a class="w3-right w3-btn" href="tag_param.asp"><span class="w3-hide-small">Next </span>❯</a> </div> <div id="mypagediv2" style="position:relative;text-align:center;"></div> <br> </div> <div class="w3-col l2 m12" id="right"> <div class="sidesection"> <div id="skyscraper"> <div id="adngin-sidebar_top-0" data-google-query-id="CJXA_sueqvcCFXiOSwUd2fYBLg"><div id="sn_ad_label_adngin-sidebar_top-0" class="sn_ad_label" style="color:#000000;font-size:12px;margin:0;text-align:center;">ADVERTISEMENT</div><div id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//wide_skyscraper_1__container__" style="border: 0pt none;"><iframe id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//wide_skyscraper_1" name="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//wide_skyscraper_1" title="3rd party ad content" width="320" height="50" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" role="region" aria-label="Advertisement" tabindex="0" srcdoc="" data-google-container-id="9" style="border: 0px; vertical-align: bottom;" data-load-complete="true"></iframe></div></div> </div> </div> <style> .ribbon-vid { font-size:12px; font-weight:bold; padding: 6px 20px; left:-20px; top:-10px; text-align: center; color:black; border-radius:25px; } </style> <div class="sidesection" id="video_sidesection"> <div class="w3-center" style="padding-bottom:7px"> <span class="ribbon-vid ws-yellow">NEW</span> </div> <p style="font-size: 14px;line-height: 1.5;font-family: Source Sans Pro;padding-left:4px;padding-right:4px;">We just launched<br>W3Schools videos</p> <a onclick="ga('send', 'event', 'Videos' , 'fromSidebar');" href="https://www.w3schools.com/videos/index.php" class="w3-hover-opacity"><img src="/images/htmlvideoad_footer.png" style="max-width:100%;padding:5px 10px 25px 10px" loading="lazy"></a> <a class="ws-button" style="font-size:16px;text-decoration: none !important;display: block !important; color:#FFC0C7!important; width: 100%; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; paxdding-top: 10px; padding-bottom: 20px; font-family: 'Source Sans Pro', sans-serif; text-align: center;" onclick="ga('send', 'event', 'Videos' , 'fromSidebar');" href="https://www.w3schools.com/videos/index.php">Explore now</a> </div> <div class="sidesection"> <h4><a href="/colors/colors_picker.asp">COLOR PICKER</a></h4> <a href="/colors/colors_picker.asp"> <img src="/images/colorpicker2000.png" alt="colorpicker" loading="lazy"> </a> </div> <div class="sidesection"> <!--<h4>LIKE US</h4>--> <div class="sharethis" style="visibility: visible;"> <a href="https://www.facebook.com/w3schoolscom/" target="_blank" title="Facebook"><span class="fa fa-facebook-square fa-2x"></span></a> <a href="https://www.instagram.com/w3schools.com_official/" target="_blank" title="Instagram"><span class="fa fa-instagram fa-2x"></span></a> <a href="https://www.linkedin.com/company/w3schools.com/" target="_blank" title="LinkedIn"><span class="fa fa-linkedin-square fa-2x"></span></a> <a href="https://discord.gg/6Z7UaRbUQM" target="_blank" title="Join the W3schools community on Discord"><span class="fa fa-discord fa-2x"></span></a> </div> </div> <!-- <div class="sidesection" style="border-radius:5px;color:#555;padding-top:1px;padding-bottom:8px;margin-left:auto;margin-right:auto;max-width:230px;background-color:#d4edda"> <p>Get your<br>certification today!</p> <a href="/cert/default.asp" target="_blank"> <img src="/images/w3certified_logo_250.png" style="margin:0 12px 20px 10px;max-width:80%"> </a> <a class="w3-btn w3-margin-bottom" style="text-decoration:none;border-radius:5px;" href="/cert/default.asp" target="_blank">View options</a> </div> --> <style> #courses_get_started_btn { text-decoration:none !important; background-color:#04AA6D; width:100%; border-bottom-left-radius:5px; border-bottom-right-radius:5px; padding-top:10px; padding-bottom:10px; font-family: 'Source Sans Pro', sans-serif; } #courses_get_started_btn:hover { background-color:#059862!important; } </style> <div id="internalCourses" class="sidesection"> <p style="font-size:18px;padding-left:2px;padding-right:2px;">Get certified<br>by completing<br>a course today!</p> <a href="https://courses.w3schools.com" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on courses banner in ads column');"> <div style="padding:0 20px 20px 20px"> <svg id="w3_cert_badge2" style="margin:auto;width:85%" data-name="w3_cert_badge2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><defs><style>.cls-1{fill:#04aa6b;}.cls-2{font-size:23px;}.cls-2,.cls-3,.cls-4{fill:#fff;}.cls-2,.cls-3{font-family:RobotoMono-Medium, Roboto Mono;font-weight:500;}.cls-3{font-size:20.08px;}</style></defs><circle class="cls-1" cx="150" cy="150" r="146.47" transform="translate(-62.13 150) rotate(-45)"></circle><text class="cls-2" transform="translate(93.54 63.89) rotate(-29.5)">w</text><text class="cls-2" transform="translate(107.13 56.35) rotate(-20.8)">3</text><text class="cls-2" transform="matrix(0.98, -0.21, 0.21, 0.98, 121.68, 50.97)">s</text><text class="cls-2" transform="translate(136.89 47.84) rotate(-3.47)">c</text><text class="cls-2" transform="translate(152.39 47.03) rotate(5.12)">h</text><text class="cls-2" transform="translate(167.85 48.54) rotate(13.72)">o</text><text class="cls-2" transform="translate(182.89 52.35) rotate(22.34)">o</text><text class="cls-2" transform="matrix(0.86, 0.52, -0.52, 0.86, 197.18, 58.36)">l</text><text class="cls-2" transform="matrix(0.77, 0.64, -0.64, 0.77, 210.4, 66.46)">s</text><text class="cls-3" transform="translate(35.51 186.66) rotate(69.37)"> </text><text class="cls-3" transform="matrix(0.47, 0.88, -0.88, 0.47, 41.27, 201.28)">C</text><text class="cls-3" transform="matrix(0.58, 0.81, -0.81, 0.58, 48.91, 215.03)">E</text><text class="cls-3" transform="matrix(0.67, 0.74, -0.74, 0.67, 58.13, 227.36)">R</text><text class="cls-3" transform="translate(69.16 238.92) rotate(39.44)">T</text><text class="cls-3" transform="matrix(0.85, 0.53, -0.53, 0.85, 81.47, 248.73)">I</text><text class="cls-3" transform="translate(94.94 256.83) rotate(24.36)">F</text><text class="cls-3" transform="translate(109.34 263.09) rotate(16.83)">I</text><text class="cls-3" transform="translate(124.46 267.41) rotate(9.34)">E</text><text class="cls-3" transform="translate(139.99 269.73) rotate(1.88)">D</text><text class="cls-3" transform="translate(155.7 270.01) rotate(-5.58)"> </text><text class="cls-3" transform="translate(171.32 268.24) rotate(-13.06)"> </text><text class="cls-2" transform="translate(187.55 266.81) rotate(-21.04)">.</text><text class="cls-3" transform="translate(203.27 257.7) rotate(-29.24)"> </text><text class="cls-3" transform="translate(216.84 249.83) rotate(-36.75)"> </text><text class="cls-3" transform="translate(229.26 240.26) rotate(-44.15)">2</text><text class="cls-3" transform="translate(240.39 229.13) rotate(-51.62)">0</text><text class="cls-3" transform="translate(249.97 216.63) rotate(-59.17)">2</text><text class="cls-3" transform="matrix(0.4, -0.92, 0.92, 0.4, 257.81, 203.04)">2</text><path class="cls-4" d="M196.64,136.31s3.53,3.8,8.5,3.8c3.9,0,6.75-2.37,6.75-5.59,0-4-3.64-5.81-8-5.81h-2.59l-1.53-3.48,6.86-8.13a34.07,34.07,0,0,1,2.7-2.85s-1.11,0-3.33,0H194.79v-5.86H217.7v4.28l-9.19,10.61c5.18.74,10.24,4.43,10.24,10.92s-4.85,12.3-13.19,12.3a17.36,17.36,0,0,1-12.41-5Z"></path><path class="cls-4" d="M152,144.24l30.24,53.86,14.94-26.61L168.6,120.63H135.36l-13.78,24.53-13.77-24.53H77.93l43.5,77.46.15-.28.16.28Z"></path></svg> </div> </a> <a class="w3-btn" id="courses_get_started_btn" href="https://courses.w3schools.com" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on courses banner in ads column');">Get started</a> </div> <!-- <div class="sidesection" style="margin-left:auto;margin-right:auto;max-width:230px"> <a href="https://shop.w3schools.com/" target="_blank" title="Buy W3Schools Merchandize"> <img src="/images/tshirt.jpg" style="max-width:100%;"> </a> </div> --> <div class="sidesection" id="moreAboutSubject"> </div> <!-- <div id="sidesection_exercise" class="sidesection" style="background-color:#555555;max-width:200px;margin:auto;margin-bottom:32px"> <div class="w3-container w3-text-white"> <h4>Exercises</h4> </div> <div> <div class="w3-light-grey"> <a target="_blank" href="/html/exercise.asp" style="padding-top:8px">HTML</a> <a target="_blank" href="/css/exercise.asp">CSS</a> <a target="_blank" href="/js/exercise_js.asp">JavaScript</a> <a target="_blank" href="/sql/exercise.asp">SQL</a> <a target="_blank" href="/php/exercise.asp">PHP</a> <a target="_blank" href="/python/exercise.asp">Python</a> <a target="_blank" href="/bootstrap/exercise_bs3.asp">Bootstrap</a> <a target="_blank" href="/jquery/exercise_jq.asp" style="padding-bottom:8px">jQuery</a> </div> </div> </div> --> <div class="sidesection codegameright ws-turquoise" style="font-size:18px;font-family: 'Source Sans Pro', sans-serif;border-radius:5px;color:#FFC0C7;padding-top:12px;margin-left:auto;margin-right:auto;max-width:230px;"> <style> .codegameright .w3-btn:link,.codegameright .w3-btn:visited { background-color:#04AA6D; border-radius:5px; } .codegameright .w3-btn:hover,.codegameright .w3-btn:active { background-color:#059862!important; text-decoration:none!important; } </style> <h4><a href="/codegame/index.html" class="w3-hover-text-black">CODE GAME</a></h4> <a href="/codegame/index.html" target="_blank" class="w3-hover-opacity"><img style="max-width:100%;margin:16px 0;" src="/images/w3lynx_200.png" alt="Code Game" loading="lazy"></a> <a class="w3-btn w3-block ws-black" href="/codegame/index.html" target="_blank" style="padding-top:10px;padding-bottom:10px;margin-top:12px;border-top-left-radius: 0;border-top-right-radius: 0">Play Game</a> </div> <!-- <div class="sidesection w3-light-grey" style="margin-left:auto;margin-right:auto;max-width:230px"> <div class="w3-container w3-dark-grey"> <h4><a href="/howto/default.asp" class="w3-hover-text-white">HOW TO</a></h4> </div> <div class="w3-container w3-left-align w3-padding-16"> <a href="/howto/howto_js_tabs.asp">Tabs</a><br> <a href="/howto/howto_css_dropdown.asp">Dropdowns</a><br> <a href="/howto/howto_js_accordion.asp">Accordions</a><br> <a href="/howto/howto_js_sidenav.asp">Side Navigation</a><br> <a href="/howto/howto_js_topnav.asp">Top Navigation</a><br> <a href="/howto/howto_css_modals.asp">Modal Boxes</a><br> <a href="/howto/howto_js_progressbar.asp">Progress Bars</a><br> <a href="/howto/howto_css_parallax.asp">Parallax</a><br> <a href="/howto/howto_css_login_form.asp">Login Form</a><br> <a href="/howto/howto_html_include.asp">HTML Includes</a><br> <a href="/howto/howto_google_maps.asp">Google Maps</a><br> <a href="/howto/howto_js_rangeslider.asp">Range Sliders</a><br> <a href="/howto/howto_css_tooltip.asp">Tooltips</a><br> <a href="/howto/howto_js_slideshow.asp">Slideshow</a><br> <a href="/howto/howto_js_sort_list.asp">Sort List</a><br> </div> </div> --> <!-- <div class="sidesection w3-round" style="margin-left:auto;margin-right:auto;max-width:230px"> <div class="w3-container ws-black" style="border-top-right-radius:5px;border-top-left-radius:5px;"> <h5><a href="/cert/default.asp" class="w3-hover-text-white">Certificates</a></h5> </div> <div class="w3-border" style="border-bottom-right-radius:5px;border-bottom-left-radius:5px;"> <a href="/cert/cert_html.asp" class="w3-button ws-grey w3-block w3-border-bottom" style="text-decoration:none">HTML</a> <a href="/cert/cert_css.asp" class="w3-button ws-grey w3-block w3-border-bottom" style="text-decoration:none">CSS</a> <a href="/cert/cert_javascript.asp" class="w3-button ws-grey w3-block w3-border-bottom" style="text-decoration:none">JavaScript</a> <a href="/cert/cert_frontend.asp" class="w3-button ws-grey w3-block w3-border-bottom" style="text-decoration:none">Front End</a> <a href="/cert/cert_python.asp" class="w3-button ws-grey w3-block w3-border-bottom" style="text-decoration:none">Python</a> <a href="/cert/cert_sql.asp" class="w3-button ws-grey w3-block w3-border-bottom" style="text-decoration:none">SQL</a> <a href="/cert/default.asp" class="w3-button ws-grey w3-block" style="text-decoration:none;">And more</a> </div> </div> --> <div id="stickypos" class="sidesection" style="text-align:center;position:sticky;top:50px;"> <div id="stickyadcontainer" style="width: 653.984px;"> <div style="position:relative;margin:auto;"> <div id="adngin-sidebar_sticky-0-stickypointer" style=""><div id="adngin-sidebar_sticky-0" style=""><div id="sn_ad_label_adngin-sidebar_sticky-0" class="sn_ad_label" style="color:#000000;font-size:12px;margin:0;text-align:center;">ADVERTISEMENT</div></div></div> <script> function secondSnigel() { if(window.adngin && window.adngin.adnginLoaderReady) { if (Number(w3_getStyleValue(document.getElementById("main"), "height").replace("px", "")) > 2200) { if (document.getElementById("adngin-mid_content-0")) { adngin.queue.push(function(){ adngin.cmd.startAuction(["sidebar_sticky", "mid_content" ]); }); } else { adngin.queue.push(function(){ adngin.cmd.startAuction(["sidebar_sticky"]); }); } } else { if (document.getElementById("adngin-mid_content-0")) { adngin.queue.push(function(){ adngin.cmd.startAuction(["mid_content"]); }); } } } else { window.addEventListener('adnginLoaderReady', function() { if (Number(w3_getStyleValue(document.getElementById("main"), "height").replace("px", "")) > 2200) { if (document.getElementById("adngin-mid_content-0")) { adngin.queue.push(function(){ adngin.cmd.startAuction(["sidebar_sticky", "mid_content" ]); }); } else { adngin.queue.push(function(){ adngin.cmd.startAuction(["sidebar_sticky"]); }); } } else { if (document.getElementById("adngin-mid_content-0")) { adngin.queue.push(function(){ adngin.cmd.startAuction(["mid_content"]); }); } } }); } } </script> </div> </div> </div> <script> uic_r_c() </script> </div> </div> <div id="footer" class="footer w3-container w3-white"> <hr> <div style="overflow:auto"> <div class="bottomad"> <!-- BottomMediumRectangle --> <!--<pre>bottom_medium_rectangle, all: [970,250][300,250][336,280]</pre>--> <div id="adngin-bottom_left-0" style="padding:0 10px 10px 0;float:left;width:auto;" data-google-query-id="CJbA_sueqvcCFXiOSwUd2fYBLg"><div id="sn_ad_label_adngin-bottom_left-0" class="sn_ad_label" style="color:#000000;font-size:12px;margin:0;text-align:center;">ADVERTISEMENT</div><div id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//bottom_medium_rectangle_1__container__" style="border: 0pt none;"><iframe id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//bottom_medium_rectangle_1" name="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//bottom_medium_rectangle_1" title="3rd party ad content" width="300" height="250" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" role="region" aria-label="Advertisement" tabindex="0" srcdoc="" data-google-container-id="a" style="border: 0px; vertical-align: bottom;" data-load-complete="true"></iframe></div></div> <!-- adspace bmr --> <!-- RightBottomMediumRectangle --> <!--<pre>right_bottom_medium_rectangle, desktop: [300,250][336,280]</pre>--> <div id="adngin-bottom_right-0" style="padding:0 10px 10px 0;float:left;width:auto;"><div id="sn_ad_label_adngin-bottom_right-0" class="sn_ad_label" style="color:#000000;font-size:12px;margin:0;text-align:center;">ADVERTISEMENT</div></div> </div> </div> <hr> <div class="w3-row-padding w3-center w3-small" style="margin:0 -16px;"> <div class="w3-col l3 m3 s12"> <a class="w3-button ws-grey ws-hover-black w3-block w3-round" href="javascript:void(0);" onclick="displayError();return false" style="white-space:nowrap;text-decoration:none;margin-top:1px;margin-bottom:1px;font-size:15px;">Report Error</a> </div> <!-- <div class="w3-col l3 m3 s12"> <a class="w3-button w3-light-grey w3-block" href="javascript:void(0);" target="_blank" onclick="printPage();return false;" style="text-decoration:none;margin-top:1px;margin-bottom:1px">PRINT PAGE</a> </div> --> <div class="w3-col l3 m3 s12"> <a class="w3-button ws-grey ws-hover-black w3-block w3-round" href="/forum/default.asp" target="_blank" style="text-decoration:none;margin-top:1px;margin-bottom:1px;font-size:15px">Forum</a> </div> <div class="w3-col l3 m3 s12"> <a class="w3-button ws-grey ws-hover-black w3-block w3-round" href="/about/default.asp" target="_top" style="text-decoration:none;margin-top:1px;margin-bottom:1px;font-size:15px">About</a> </div> <div class="w3-col l3 m3 s12"> <a class="w3-button ws-grey ws-hover-black w3-block w3-round" href="https://shop.w3schools.com/" target="_blank" style="text-decoration:none;margin-top:1px;margin-bottom:1px;font-size:15px">Shop</a> </div> </div> <hr> <div class="ws-grey w3-padding w3-margin-bottom" id="err_form" style="display:none;position:relative"> <span onclick="this.parentElement.style.display='none'" class="w3-button w3-display-topright w3-large">×</span> <h2>Report Error</h2> <p>If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:</p> <p>help@w3schools.com</p> <br> <!-- <h2>Your Suggestion:</h2> <form> <div class="w3-section"> <label for="err_email">Your E-mail:</label> <input class="w3-input w3-border" type="text" style="margin-top:5px;width:100%" id="err_email" name="err_email"> </div> <div class="w3-section"> <label for="err_email">Page address:</label> <input class="w3-input w3-border" type="text" style="width:100%;margin-top:5px" id="err_url" name="err_url" disabled="disabled"> </div> <div class="w3-section"> <label for="err_email">Description:</label> <textarea rows="10" class="w3-input w3-border" id="err_desc" name="err_desc" style="width:100%;margin-top:5px;resize:vertical;"></textarea> </div> <div class="form-group"> <button type="button" class="w3-button w3-dark-grey" onclick="sendErr()">Submit</button> </div> <br> </form> --> </div> <div class="w3-container ws-grey w3-padding" id="err_sent" style="display:none;position:relative"> <span onclick="this.parentElement.style.display='none'" class="w3-button w3-display-topright">×</span> <h2>Thank You For Helping Us!</h2> <p>Your message has been sent to W3Schools.</p> </div> <div class="w3-row w3-center w3-small"> <div class="w3-col l3 m6 s12"> <div class="top10"> <h5 style="font-family: 'Source Sans Pro', sans-serif;">Top Tutorials</h5> <a href="/html/default.asp">HTML Tutorial</a><br> <a href="/css/default.asp">CSS Tutorial</a><br> <a href="/js/default.asp">JavaScript Tutorial</a><br> <a href="/howto/default.asp">How To Tutorial</a><br> <a href="/sql/default.asp">SQL Tutorial</a><br> <a href="/python/default.asp">Python Tutorial</a><br> <a href="/w3css/default.asp">W3.CSS Tutorial</a><br> <a href="/bootstrap/bootstrap_ver.asp">Bootstrap Tutorial</a><br> <a href="/php/default.asp">PHP Tutorial</a><br> <a href="/java/default.asp">Java Tutorial</a><br> <a href="/cpp/default.asp">C++ Tutorial</a><br> <a href="/jquery/default.asp">jQuery Tutorial</a><br> </div> </div> <div class="w3-col l3 m6 s12"> <div class="top10"> <h5 style="font-family: 'Source Sans Pro', sans-serif;">Top References</h5> <a href="/tags/default.asp">HTML Reference</a><br> <a href="/cssref/default.asp">CSS Reference</a><br> <a href="/jsref/default.asp">JavaScript Reference</a><br> <a href="/sql/sql_ref_keywords.asp">SQL Reference</a><br> <a href="/python/python_reference.asp">Python Reference</a><br> <a href="/w3css/w3css_references.asp">W3.CSS Reference</a><br> <a href="/bootstrap/bootstrap_ref_all_classes.asp">Bootstrap Reference</a><br> <a href="/php/php_ref_overview.asp">PHP Reference</a><br> <a href="/colors/colors_names.asp">HTML Colors</a><br> <a href="/java/java_ref_keywords.asp">Java Reference</a><br> <a href="/angular/angular_ref_directives.asp">Angular Reference</a><br> <a href="/jquery/jquery_ref_overview.asp">jQuery Reference</a><br> </div> </div> <div class="w3-col l3 m6 s12"> <div class="top10"> <h5 style="font-family: 'Source Sans Pro', sans-serif;">Top Examples</h5> <a href="/html/html_examples.asp">HTML Examples</a><br> <a href="/css/css_examples.asp">CSS Examples</a><br> <a href="/js/js_examples.asp">JavaScript Examples</a><br> <a href="/howto/default.asp">How To Examples</a><br> <a href="/sql/sql_examples.asp">SQL Examples</a><br> <a href="/python/python_examples.asp">Python Examples</a><br> <a href="/w3css/w3css_examples.asp">W3.CSS Examples</a><br> <a href="/bootstrap/bootstrap_examples.asp">Bootstrap Examples</a><br> <a href="/php/php_examples.asp">PHP Examples</a><br> <a href="/java/java_examples.asp">Java Examples</a><br> <a href="/xml/xml_examples.asp">XML Examples</a><br> <a href="/jquery/jquery_examples.asp">jQuery Examples</a><br> </div> </div> <div class="w3-col l3 m6 s12"> <div class="top10"> <!-- <h4>Web Certificates</h4> <a href="/cert/default.asp">HTML Certificate</a><br> <a href="/cert/default.asp">CSS Certificate</a><br> <a href="/cert/default.asp">JavaScript Certificate</a><br> <a href="/cert/default.asp">SQL Certificate</a><br> <a href="/cert/default.asp">Python Certificate</a><br> <a href="/cert/default.asp">PHP Certificate</a><br> <a href="/cert/default.asp">Bootstrap Certificate</a><br> <a href="/cert/default.asp">XML Certificate</a><br> <a href="/cert/default.asp">jQuery Certificate</a><br> <a href="//www.w3schools.com/cert/default.asp" class="w3-button w3-margin-top w3-dark-grey" style="text-decoration:none"> Get Certified »</a> --> <h5 style="font-family: 'Source Sans Pro', sans-serif;">Web Courses</h5> <a href="https://courses.w3schools.com/courses/html" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on html course link in footer');">HTML Course</a><br> <a href="https://courses.w3schools.com/courses/css" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on css course link in footer');">CSS Course</a><br> <a href="https://courses.w3schools.com/courses/javascript" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on javascript course link in footer');">JavaScript Course</a><br> <a href="https://courses.w3schools.com/programs/front-end" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on Front End course link in footer');">Front End Course</a><br> <a href="https://courses.w3schools.com/courses/sql" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on sql course link in footer');">SQL Course</a><br> <a href="https://courses.w3schools.com/courses/python" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on python course link in footer');">Python Course</a><br> <a href="https://courses.w3schools.com/courses/php" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on php course link in footer');">PHP Course</a><br> <a href="https://courses.w3schools.com/courses/jquery" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on jquery course link in footer');">jQuery Course</a><br> <a href="https://courses.w3schools.com/courses/java" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on Java course link in footer');">Java Course</a><br> <a href="https://courses.w3schools.com/courses/cplusplus" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on C++ course link in footer');">C++ Course</a><br> <a href="https://courses.w3schools.com/courses/c-sharp" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on bootstrap C# link in footer');">C# Course</a><br> <a href="https://courses.w3schools.com/courses/xml" target="_blank" onclick="ga('send', 'event', 'Courses' , 'Clicked on xml course link in footer');">XML Course</a><br> <a href="https://courses.w3schools.com/" target="_blank" class="w3-button w3-margin-top ws-black ws-hover-black w3-round" style="text-decoration:none" onclick="ga('send', 'event', 'Courses' , 'Clicked on get certified button in footer');"> Get Certified »</a> </div> </div> </div> <hr> <div class="w3-center w3-small w3-opacity"> W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our <a href="/about/about_copyright.asp">terms of use</a>, <a href="/about/about_privacy.asp">cookie and privacy policy</a>.<br><br> <a href="/about/about_copyright.asp">Copyright 1999-2022</a> by Refsnes Data. All Rights Reserved.<br> <a href="//www.w3schools.com/w3css/default.asp">W3Schools is Powered by W3.CSS</a>.<br><br> </div> <div class="w3-center w3-small"> <a href="//www.w3schools.com"> <i class="fa fa-logo ws-text-green ws-hover-text-green" style="position:relative;font-size:42px!important;"></i> </a></div><a href="//www.w3schools.com"> <br><br> </a></div><a href="//www.w3schools.com"> </a></div><iframe name="__tcfapiLocator" style="display: none;"></iframe><iframe name="__uspapiLocator" style="display: none;"></iframe><a href="//www.w3schools.com"> <script src="/lib/w3schools_footer.js?update=20220202"></script> <script> MyLearning.loadUser('footer'); function docReady(fn) { document.addEventListener("DOMContentLoaded", fn); if (document.readyState === "interactive" || document.readyState === "complete" ) { fn(); } } uic_r_z(); uic_r_d() </script><iframe src="https://56d0da6c34aaa471db22bb4266aac656.safeframe.googlesyndication.com/safeframe/1-0-38/html/container.html" style="visibility: hidden; display: none;"></iframe> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </a><script type="text/javascript" src="https://geo.moatads.com/n.js?e=35&ol=3318087536&qn=%604%7BZEYwoqI%24%5BK%2BdLLU)%2CMm~tM!90vv9L%24%2FoDb%2Fz(lKm3GFlNUU%2Cu%5Bh_GcS%25%5BHvLU%5B4(K%2B%7BgeFWl_%3DNqUXR%3A%3D%2BAxMn%3Ch%2CyenA8p%2FHm%24%60%233P(ry5*ZRocMp1tq%5BN%7Bq%60RP%3CG.ceFW%7CoG%22mxT%3Bwv%40V374BKm55%3D%261fp%5BoU5t(KX%3C%3Ce%24%26%3B%23wPjrBEe31k5X%5BG%5E%5B)%2C2iVSWf3Stnq%263t!9jr%7BRzI%2C%7BOCb%25%24(%3DNqU%60W5u%7Bo(zs1CoK%2Bdr%5BG)%2C3ii)RGL3emgSuRVE&tf=1_nMzjG---CSa7H-1SJH-bW7qhB-LRwqH-nMzjG-&vi=111111&rb=2-90xv0J4P%2FoMsPm8%2BZbNmT2EB%2BBOA3JNdQL68hLPh4bg2%2F%2FnQIIWF3Q%3D%3D&rs=1-iHtHGE9B1zA1OQ%3D%3D&sc=1&os=1-3g%3D%3D&qp=10000&is=BBBBB2BBEYBvGl2BBCkqtUTE1RmsqbKW8BsrBu0rCFE48CRBeeBS2hWTMBBQeQBBn2soYggyUig0CBlWZ0uBBCCCCCCOgRBBiOfnE6Bkg7Oxib8MxOtJYHCBdm5kBhIcC9Y8oBXckXBR76iUUsJBCBBBBBBBBBWBBBj3BBBZeGV2BBBCMciUBBBjgEBBBBBB94UMgTdJMtEcpMBBBQBBBniOccBBBBBB47kNwxBbBBBBBBBBBhcjG6BBJM2L4Bk8BwCBQmIoRBBCzBz1BBCTClBBrbGBC4ehueB57NG9aJeRzBqEKBBBBBBB&iv=8&qt=0&gz=0&hh=0&hn=0&tw=&qc=0&qd=0&qf=1240&qe=883&qh=1280&qg=984&qm=-330&qa=1280&qb=1024&qi=1280&qj=984&to=000&po=1-0020002000002120&vy=ot%24b%5Bh%40%22oDgO%3DLlE6%3Avy%2CUitwb4%5Du!%3CFo%40Y_3r%3F%5DAY~MhXyz%26_%5B*Rp%7C%3EoDKmsiFDRz%5EmlNM%22%254ZpaR%5BA7Do%2C%3Bg%2C%2C%40W7RbzTmejO%3Def%2C%7Bvp%7C9%7C_%3Bm_Qrw5.W%2F84VKp%40i6AKx!ehV%7Du!%3CFo%40pF&ql=%3B%5BpwxnRd%7Dt%3Aa%5DmJVOG)%2C~%405%2F%5BGI%3F6C(TgPB*e%5D1(rI%24(rj2Iy!pw%40aOS%3DyNX8Y%7BQgPB*e%5D1(rI%24(rj%5EB61%2F%3DSqcMr1%7B%2CJA%24Jz_%255tTL%3Fwbs_T%234%25%60X%3CA&qo=0&qr=0&i=TRIPLELIFT1&hp=1&wf=1&ra=1&pxm=8&sgs=3&vb=6&kq=1&hq=0&hs=0&hu=0&hr=0&ht=1&dnt=0&bq=0&f=0&j=https%3A%2F%2Fwww.google.com&t=1650718754860&de=466991431602&m=0&ar=bee2df476bf-clean&iw=2a1d5c5&q=2&cb=0&ym=0&cu=1650718754860&ll=3&lm=0&ln=1&r=0&em=0&en=0&d=6737%3A94724%3Aundefined%3A10&zMoatTactic=undefined&zMoatPixelParams=aid%3A29695277962791520917040%3Bsr%3A10%3Buid%3A0%3B&zMoatOrigSlicer1=2662&zMoatOrigSlicer2=39&zMoatJS=-&zGSRC=1&gu=https%3A%2F%2Fwww.w3schools.com%2Ftags%2Ftag_p.asp&id=1&ii=4&bo=2662&bd=w3schools.com&gw=triplelift879988051105&fd=1&ac=1&it=500&ti=0&ih=1&pe=1%3A512%3A512%3A1026%3A846&jm=-1&fs=198121&na=2100642455&cs=0&ord=1650718754860&jv=1483802810&callback=DOMlessLLDcallback_5147906"></script><iframe src="https://www.google.com/recaptcha/api2/aframe" width="0" height="0" style="display: none;"></iframe></body><iframe sandbox="allow-scripts allow-same-origin" id="936be7941bd9c5c" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://jp-u.openx.net/w/1.0/pd?plm=6&ph=8a7ca719-8c2c-4c16-98ad-37ac6dbf26e9&gdpr=0&us_privacy=1---"> </iframe><iframe sandbox="allow-scripts allow-same-origin" id="94da8182082e79b" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://eus.rubiconproject.com/usync.html?us_privacy=1---"> </iframe><iframe sandbox="allow-scripts allow-same-origin" id="950ad185776f97c" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://cdn.connectad.io/connectmyusers.php?us_privacy=1---&"> </iframe><iframe sandbox="allow-scripts allow-same-origin" id="960961bdb263a5c" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://ads.pubmatic.com/AdServer/js/user_sync.html?kdntuid=1&p=157369&gdpr=0&gdpr_consent=&us_privacy=1---"> </iframe><iframe sandbox="allow-scripts allow-same-origin" id="973d77507d8ed2c" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://s.amazon-adsystem.com/iu3?cm3ppd=1&d=dtb-pub&csif=t&dl=n-index_pm-db5_ym_rbd_n-vmg_ox-db5_smrt_an-db5_3lift"> </iframe><iframe sandbox="allow-scripts allow-same-origin" id="986df094b3ccc6f" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://biddr.brealtime.com/check.html"> </iframe><iframe sandbox="allow-scripts allow-same-origin" id="9984b091a86efa7" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://js-sec.indexww.com/um/ixmatch.html"> </iframe><iframe sandbox="allow-scripts allow-same-origin" id="1004b17db44af55b" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://csync.smilewanted.com?us_privacy=1---"> </iframe><iframe sandbox="allow-scripts allow-same-origin" id="101af22cac10bcfd" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://onetag-sys.com/usync/?cb=1650718752982&us_privacy=1---"> </iframe><iframe sandbox="allow-scripts allow-same-origin" id="10290b51ae900f2b" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://eb2.3lift.com/sync?us_privacy=1---&"> </iframe><iframe sandbox="allow-scripts allow-same-origin" id="103d27603dbc3983" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="https://acdn.adnxs.com/dmp/async_usersync.html"> </iframe></html>
koroshiya / Renpy Image DefinerAutomates the definition of character sprites, backgrounds, and any other images used in a Renpy game
jarjumarvin / Sejong BotA Discord bot for learners of the Korean language. Provides definitions, chinese character search, as well as example sentences and neural machine translation powered by Papago NMT.
hardmaru / Cantonese ListList of 4000 Chinese characters sorted by historical usage frequency, with Cantonese yale romanization and definition
rahulthawal / Finding Object By Robotic ArmDependencies OpenCV The Open Computer Vision library, in the form of python, was used to perform image parsing and analysis. This was used to apply a masking filter to each image, then parse each image for the contours of the marker / target. Numpy The Numerical Python (Numpy) library was used to provide advanced array and matrix functionality for the mathematics used in the program. In particular, the arrays were used for creating and passing the necessary RGB (in this instance, BGR) vectors for creating the appropriate mask. Access The Python program has been designed to run at the allocated hours of each member of Team 4 automatically (See below for a time table). It first starts by retrieving the system time of the executing host and compares it to the hard-coded times for each member. If the system time does not coincide with members' time, the program will inform the user through Standard Output and close. Otherwise, the program will continue with the Execution Procedure. Function Definitions readResponse() Takes the encoded response from the server after issuing a command and parses through the encoded white-space characters for more a more user-friendly report. getCoords(output) Given the output from the server, it parses through the data to find the X, Y, and Z co-ordinates. sendAJMA() Sends the Angular commands to the server to move the arm. After issuing, it acquires the resulting X, Y, and Z co-ordinates from the parsed return output. sendCapture() Sends the capture command to the server and prints the response. find_marker(image) Given an input image, the function parses over each pixel, applying a mask. After massaging the data, it attempts to find contours within the image to find a target marker (for example, a piece of paper). download_image(url, filename) Issues a HTTP request for an image. rawCommand(givenData) Parses through the encoded response from the server and makes it more user-friendly. printData() Does the actual printing of parsed data for the user's benefit. downloadCheckImage() First, it attempts to download the latest image from the server and reports any errors it encounters. Then, it parses the image for the marker if possible and displays the image to the user. testCom() With an initial list of commands for the arm, it proceeds to iterate through them while checking each image for the marker/box. After locating it, it proceeds to center the camera horizontally on the box and then vertically. After having centered the camera on the box, it will proceed to use forward kinematics to calculate the box's location. Execution Procedure The program proceeds to first authenticate with the R12 server. On success, it proceeds to call on the primary driver, testComm, to find the box. This process then instructs the arm for move, capture an image, downloads the image, and parses it for the target. All the while, reporting all pertinent data to the user for diagnostics purposes.
illruse / JanitorAIHidden Character Definitions of many bots, compiled together to be able to clone and edit bots easily.
zoebchhatriwala / CamWordCamWord Is an android application that uses character recognition and voice recognition to identify a word and then translate or provide definition according to user’s choice. CamWord was developed using Google’s Open Source Tesseract Engine for Optical Character Recognition and Google’s Speech API for Voice Recognition.
Runik-3 / Runik App📖 A web app that allows users to generate custom e-book dictionaries for their favourite fictional worlds. Stay fully immersed in your book while enjoying custom definitions of items, characters, places, and more.
kafkasl / Chinese Character GeneratorGenerate dynamic Chinese character learning wallpapers with stroke order, Pinyin & Zhuyin (Bopomofo) annotations, and english definition. Perfect for language learners looking to immerse themselves in Chinese script.
mar1 / ElizadbA specialized character configuration database designed for ElizaOS, the autonomous agent framework. This project provides a structured database of character definitions that can be directly used with ElizaOS to create sophisticated AI agents.
elyukai / Optolith Database SchemaDefinitions and utilities for the flat-file database of Optolith, a character creation tool for the Pen and Paper RPG “The Dark Eye 5”, and its external integrations into other software.
1j01 / AmgDEPRECATED PROJECT IDEA - An abstracted modular game framework with integrated pixel editor and realtime asset manager and a level editor with dynamic block type definitions and a skeletal character animator and inverse kinematics and a game. Except no game.
admin1i / Https Apps.facebook.com Artexas By Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS
creamcast / Spritesheetcreator Rpgmakermvcreate a character sprite sheet for rpg maker MV based on a definition file.
divyasaxenaa / Artificial Intelligence WumpusWorldThe task in this programming assignment is to implement, a knowledge base and an inference engine for the wumpus world. First of all, you have to create a knowledge base (stored as a text file) storing the rules of the wumpus world, i.e., what we know about pits, monsters, breeze, and stench. Second, you have to create an inference engine, that given a knowledge base and a statement determines if, based on the knowledge base, the statement is definitely true, definitely false, or of unknown truth value. Command-line Arguments The program should be invoked from the commandline as follows: check_true_false wumpus_rules.txt [additional_knowledge_file] [statement_file] For example: check_true_false wumpus_rules.txt kb1.txt statement1.txt Argument wumpus_rules.txt specifies the location of a text file containing the wumpus rules, i.e., the rules that are true in any possible wumpus world, as specified above (once again, note that the specifications above are not identical to the ones in the book). Argument [additional_knowledge_file] specifies an input file that contains additional information, presumably collected by the agent as it moves from square to square. For example, see kb3.txt. Argument [statement_file] specifies an input file that contains a single logical statement. The program should check if, given the information in wumpus_rules.txt and [additional_knowledge_file], the statement in [statement_file] is definitely true, definitely false, or none of the above. Output Your program should create a text file called "result.txt". Depending on what your inference algorithm determined about the statement being true or false, the output file should contain one of the following four outputs: definitely true. This should be the output if the knowledge base entails the statement, and the knowledge base does not entail the negation of the statement. definitely false. This should be the output if the knowledge base entails the negation of the statement, and the knowledge base does not entail the statement. possibly true, possibly false. This should be the output if the knowledge base entails neither the statement nor the negation of the statement. both true and false. This should be the output if the knowledge base entails both the statement and the the negation of the statement. This happens when the knowledge base is always false (i.e., when the knowledge base is false for every single row of the truth table). Note that by "knowledge base" we are referring to the conjunction of all statements contained in wumpus_rules.txt AND in the additional knowledge file. Also note that the sample code provided below stores the words "result unknown" to the result.txt file. Also, the "both true and false" output should be given when the knowledge base (i.e., the info stored in wumpus_rules.txt AND in the additional knowledge file) entails both the statement from statement_file AND the negation of that statement. Syntax The wumpus rules file and the additional knowledge file contain multiple lines. Each line contains a logical statement. The knowledge base constructed by the program should be a conjunction of all the statements contained in the two files. The sample code (as described later) already does that. The statement file contains a single line, with a single logical statement. Statements are given in prefix notation. Some examples of prefix notation are: (or M_1_1 B_1_2) (and M_1_2 S_1_1 (not (or M_1_3 M_1_4))) (if M_1_1 (and S_1_2 S_1_3)) (iff M_1_2 (and S_1_1 S_1_3 S_2_2)) (xor B_2_2 P_1_2) P_1_1 B_3_4 (not P_1_1) Statements can be nested, as shown in the above examples. Note that: Any open parenthesis that is not the first character of a text line must be preceded by white space. Any open parenthesis must be immediately followed by a connective (without any white space in between). Any close parenthesis that is not the last character of a text line must be followed by white space. If the logical expression contains just a symbol (and no connectives), the symbol should NOT be enclosed in parentheses. For example, (P_1_1) is not legal, whereas (not P_1_1) is legal. See also the example statements given above. Each logical expression should be contained in a single line. The wumpus rules file and the additional knowledge file contain a set of logical expressions. The statement file should contain a single logical expression. If it contains more than one logical expression, only the first one is read. Lines starting with # are treated as comment lines, and ignored. You can have empty lines, but they must be totally empty. If a line has a single space on it (and nothing more) the program will complain and not read the file successfully. There are six connectives: and, or, xor, not, if, iff. No other connectives are allowed to be used in the input files. Here is some additional information: A statement can consist of either a single symbol, or a connective connecting multiple (sub)statements. Notice that this is a recursive definition. In other words, statements are symbols or more complicated statements that we can make by connecting simpler statements with one of the six connectives. Connectives "and", "or", and "xor" can connect any number of statements, including 0 statements. It is legal for a statement consisting of an "and", "or", or "xor" connective to have no substatements, e.g., (and). An "and" statement with zero substatements is true. An "or" or "xor" statement with zero substatements is false. An "xor" statement is true if exactly 1 substatement is true (no more, no fewer). Connectives "if" and "iff" require exactly two substatements. Connective "not" requires exactly one substatement. The only symbols that are allowed to be used are: M_i_j (standing for "there is a monster at square (i, j)). S_i_j (standing for "there is a stench at square (i, j)). P_i_j (standing for "there is a pit at square (i, j)). B_i_j (standing for "there is a breeze at square (i, j)). NO OTHER SYMBOLS ARE ALLOWED. Also, note that i and j can take values 1, 2, 3, and 4. In other words, there will be 16 unique symbols of the form M_i_j, 16 unique symbols of the form S_i_j, 16 unique symbols of the form P_i_j, and 16 unique symbols of the form B_i_j, for a total of 64 unique symbols. The Wumpus Rules Here is what we know to be true in any wumpus world, for the purposes of this assignment (NOTE THAT THESE RULES ARE NOT IDENTICAL TO THE ONES IN THE TEXTBOOK): If there is a monster at square (i,j), there is stench at all adjacent squares. If there is stench at square (i,j), there is a monster at one of the adjacent squares. If there is a pit at square (i,j), there is breeze at all adjacent squares. If there is breeze at square (i,j), there is a pit at one or more of the adjacent squares. There is one and only one monster (no more, no fewer). Squares (1,1), (1,2), (2,1), (2,2) have no monsters and no pits. The number of pits can be between 1 and 11. We don't care about gold, glitter, and arrows, there will be no information about them in the knowledge base, and no reference to them in the statement. Sample code The following code implements, in Java and C++, a system that reads text files containing information for the knowledge base and the statement whose truth we want to check. Feel free to use that code and build on top of it. Also feel free to ignore that code and start from scratch. Java: files CheckTrueFalse.java and LogicalExpression.java C++: files check_true_false.cpp and check_true_false.h Python (ver 2.4): check_true_false.py and logical_expression.py. (Zipped version of files here). You can test this code, by compiling on omega, and running on input files a.txt, b.txt, and c.txt. For example, for the Java code you can run it as: javac *.java java CheckTrueFalse a.txt b.txt c.txt and for C++, you can do: g++ -o check_true_false check_true_false.cpp ./check_true_false a.txt b.txt c.txt Efficiency Brute-force enumeration of the 264 possible assignments to the 64 Boolean variables will be too inefficient to produce answers in a reasonable amount of time. Because of that, we will only be testing your solutions with cases where the additional knowledge file contains specific information about at least 48 of the symbols. For example, suppose that the agent has already been at square (2,3). Then, the agent knows for that square that: There is no monster (otherwise the agent would have died). There is no pit (otherwise the agent would have died). Furthermore, the agent knows whether or not there is stench and/or breeze at that square. Suppose that, in our example, there is breeze and no stench. Then, the additional knowledge file would contain these lines for square 2,3: (not M_2_3) (not P_2_3) B_2_3 (not S_2_3) You can assume that, in all our test cases, there will be at least 48 lines like these four lines shown above, specifying for at least 48 symbols whether they are true or false. Assuming that you implement the TT-Entails algorithm, your program should identify those symbols and their values right at the beginning. You can identify those symbols using these guidelines: Note that the sample code stores the knowledge base as a LogicalExpression object, whose connective at the root is an AND. Let's call this LogicalExpression object knowledge_base. Suppose that you have a line such as "B_2_3" in the additional knowledge file. Such a line generates a child of knowledge_base that is a leaf, and has its "symbol" variable set to "B_2_3". You can write code that explicitly looks for such children of knowledge_base. Suppose that you have a line such as "(not M_2_3") in the additional knowledge file. Such a line generates a child of knowledge_base whose connective is NOT, and whose only child is a leaf with its "symbol" variable set to "M_2_3". You can write code that explicitly looks for such children of knowledge_base. This way, your program will be able to initialize the model that TT-Entails passes to TT-Check-All with boolean assignments for at least 48 symbols, as opposed to passing an empty model. The list of symbols passed from TT-Entails to TT-Check-All should obviously NOT include the symbols that have been assigned values in the initial model. This way, at most 16 symbols will have unspecified values, and TT-Check-All will need to check at most 216 rows in the truth table, which is quite doable in a reasonable amount of time (a few seconds).
dakotale-zz / Text Chat ApplicationCSE4/589: PA1 Description CSE 489/589 Programming Assignment 1 Text Chat Application 1. Objectives Develop the client and server components of a text chat application, consisting of one chat server and multiple chat clients over TCP connections. 2. Getting Started 2.1 Socket Programming Beej Socket Guide: http://beej.us/guide/bgnet 2.2 Install the PA1 template Read the document at https://goo.gl/L2kgb5 in full and install the template. You should complete this step before reading further. It is mandatory to use this template. 3. Implementation 3.1 Programming environment You will write C (or C++) code that compiles under the GCC (GNU Compiler Collection) environment. Furthermore, you should ensure that your code compiles and operates correctly on 5 dedicated hosts/machines, which will be provided to you by the instructor. Your code should successfully compile using the version of gcc (for C code) or g++ (for C++ code) found on the 5 dedicated hosts and should function correctly when executed. NOTE: You are NOT allowed to use any external (not present by default on the dedicated hosts) libraries for the socket programming part. Bundling of code (or part of it) from external libraries with your source will not be accepted either. You can however use external modules for other parts of the assignment (like maintaining a linked list). If you are not sure whether you are allowed to use an external library or not, consult with the course staff. Further, your implementation should NOT invoke any external binaries (e.g., ifconfig, nslookup, etc.) and should NOT involve any disk I/O unless explicitly mentioned in the PA description. 3.2 Sockets Use TCP Sockets only for your implementation. Use the select() system call only for handling multiple socket connections. Do not use multi-threading or fork-exec. 3.3 Running your program Your program will take 2 command line parameters: The first parameter (s/c) indicates whether your program instance should run as a server or a client. The second parameter (number) is the port number on which your process will listen for incoming connections. In the rest of the document, this port is referred to as the listening port. E.g., if your executable is named chat_app: To run as a server listening on port 4322 ./chat_app s 4322 To run as a client listening on port 4322 ./chat_app c 4322 3.4 Dedicated Hosts For the purpose of this assignment, you should only use (for development and/or testing) the directory created for you on each of the 5 dedicated hosts. Change the access permission to this directory so that only you are allowed to access the contents of the directory. This is to prevent others from getting access to your code. 4. Output Format We will use automated tests to grade this assignment. The grader, among other things, will also look at the output generated by your program. Towards this end, ALL the required output (as described in section 5) generated by your program needs to be written to BOTH stdout and to a specific logfile. Later sections provide the exact format strings to be used for output, which need to be strictly followed. 4.1 Print and LOG We have already provided a convenience function for this purpose in the template (see src/logger.c and include/logger.h), which writes both to stdout and to the logfile. You should use ONLY this function, for all output described in this assignment. On the other hand, if you want to output something more to stdout (for debugging etc.) than what is described, do NOT use this function and rather use native C/C++ function calls. Any extra output in the log file will cause the test cases to fail. To use the function, you will need to have the following statement at the top of your .c/.cpp source file(s) where you want to use this function: #include “../include/logger.h” The function is designed to behave almost exactly as printf. You can use the function as: cse4589_print_and_log(char* format, ...) Read the comments above the function definition contained in the src/logger.c file, for more information on the arguments and return value. 5. Detailed Description The chat application follows a typical client-server model, whereby we will have one server instance and two or more client instances. Given that we will be testing on the five dedicated hosts listed before, you can assume that at most four clients will be online at any given time. The clients, when launched, log in to the server, identify themselves, and obtain the list of other clients that are connected to the server. Clients can either send a unicast message to any one of the other clients or a broadcast a message to all the other clients. Note that the clients maintain an active connection only with the server and not with any other clients. Consequently, all messages exchanged between the clients must flow through the server. Clients never exchange messages directly with each other. The server exists to facilitate the exchange of messages between the clients. The server can exchange control messages with the clients. Among other things, it maintains a list of all clients that are connected to it, and their related information (IP address, port number, etc.). Further, the server stores/buffers any messages destined to clients that are not logged-in at the time of the receipt of the message at the server from the sender, to be delivered at a later time when the client logs in to the server. You do NOT need to buffer messages for EXITed clients or from BLOCKed clients (see section 5.6). You can assume that the total number of buffered messages will not exceed 100. Your code, when compiled, will produce a single executable file. Depending on what arguments are passed to this executable (see section 3.3), a client or a server instance should be started. 5.1 Network and SHELL Dual Functionality When launched (either as server or client), your application should work like a UNIX shell accepting specific commands (described below), in addition to performing network operations required for the chat application to work. You will need to use the select() system call which will allow you to provide a user interface and perform network functions at the same time (simultaneously). 5.2 SHELL Commands Your application should accept commands only when they are inputted: In UPPER CASE. Having exactly the same syntax as described below. 5.3. SHELL Command Output [IMPORTANT] The first line of output of all the commands should declare whether it was successfully executed or it failed. If the command was successful, use the following format string: (“[%s:SUCCESS]\n”, command_str) //where command_str is the command inputted without its arguments If the command failed with error, use the following format string: (“[%s:ERROR]\n”, command_str) //where command_str is the command inputted without its arguments For all such required output, you should only use the special print/log function described in section 4. See section 5.4 (IP command) for an example code snippet. If the command is successful, it should immediately be followed by its real output (if any) as described in the sections below. Extra output lines in the log file between the success message and output will cause test cases to fail. The last line of the output of all the commands (whether success or failure) should use the following format string: (“[%s:END]\n”, command_str) //where command_str is the command inputted without its arguments For events, printing format/requirements will be the same as for commands. Each of the event’s description tells the value of the command_str you should use for it. 5.4 Server/Client SHELL Command Description This set of commands should work irrespective of whether the application is started as a server or a client. AUTHOR Print a statement using the following format string: (“I, %s, have read and understood the course academic integrity policy.\n”, your_ubit_name) Your submission will not be graded if the AUTHOR command fails to work. IP Print the IP address of this process. Note that this should not be the localhost address (127.0.0.1), but the external IP address. Use the following format string: (“IP:%s\n”, ip_addr) //where ip_addr is a null-terminated char array storing IP Example Code Snippet To generate the required output for this command, you would need the following lines in your code: //Successful cse4589_print_and_log(“[%s:SUCCESS]\n”, command_str); cse4589_print_and_log(“IP:%s\n”, ip_addr); cse4589_print_and_log(“[%s:END]\n”, command_str); //Error cse4589_print_and_log(“[%s:ERROR]\n”, command_str); cse4589_print_and_log(“[%s:END]\n”, command_str); Here, command_str and ip_str are char arrays containing “IP” and some valid IP address like “xxx.xx.xx.xx”, respectively. Any extra output in between the SUCCESS/ERROR and END output will cause the test cases to fail. PORT Print the port number this process is listening on. Use the following format string: (“PORT:%d\n”, port) LIST Display a numbered list of all the currently logged-in clients. The output should display the hostname, IP address, and the listening port numbers, sorted by their listening port numbers, in increasing order. E.g., 1 stones.cse.buffalo.edu 128.205.36.46 4545 2 embankment.cse.buffalo.edu 128.205.36.35 5000 3 highgate.cse.buffalo.edu 128.205.36.33 5499 4 euston.cse.buffalo.edu 128.205.36.34 5701 Use the following format string: /*The following printf will print out one host. Repeat this printf statement to * print all hosts * list_id: integer item number * hostname: null-terminated char array containing fully qualified hostname * ip_addr: null-terminated char array storing IP * port_num: integer storing listening port num */ ("%-5d%-35s%-20s%-8d\n", list_id, hostname, ip_addr, port_num) Notes: LIST output should contain all the currently logged-in clients, including the client that executed the command. The server should NOT be included in the output. If you do not implement the LIST command correctly, most automated tests for other commands will fail. 5.5 Server SHELL Command/Event Description This set of commands should work only when the application is started as a server. STATISTICS Display a numbered list of all the clients that have ever logged-in to the server (but have never executed the EXIT command) and statistics about each one. The output should display the hostname, #messages-sent, #messages-received, and the current status: logged-in/logged-out depending on whether the client is currently logged-in or not, sorted by their listening port numbers, in increasing order. E.g., 1 stones.cse.buffalo.edu 4 0 logged-in 2 embankment.cse.buffalo.edu 3 67 logged-out 3 highgate.cse.buffalo.edu 7 14 logged-in 4 euston.cse.buffalo.edu 11 23 logged-in Use the following format string: /*The following printf will print out one host. Repeat this printf statement to * print all hosts * list_id: integer item number * hostname: null-terminated char array containing fully qualified hostname * num_msg_sent: integer number of messages sent by the client * num_msg_rcv: integer number of messages received by the client */ * status: null-terminated char array containing logged-in or logged-out ("%-5d%-35s%-8d%-8d%-8s\n", list_id, hostname, num_msg_sent, num_msg_rcv, status) BLOCKED <client-ip> Display a numbered list of all the clients (see BLOCK command in section 5.6) blocked by the client with ip address: <client-ip>. The output should display the hostname, IP address, and the listening port numbers, sorted by their listening port numbers, in increasing order. The output format should be identical to that of the LIST command. Exceptions to be handled Invalid IP address Valid but incorrect/non-existent IP address [EVENT]: Message Relayed All messages exchanged between clients pass through (are relayed by) the server. In the event of relay of a message <msg> from a client with ip address: <from-client-ip> addressed to another client with ip address: <to-client-ip>, print/log the message using the following format string: ("msg from:%s, to:%s\n[msg]:%s\n", from-client-ip, to-client-ip, msg) In case of a broadcast message, <to-client-ip> will be 255.255.255.255 For the purposes of printing/logging, use command_str: RELAYED 5.6 Client SHELL Command/Event Description This set of commands should work only when the application is started as a client. LOGIN <server-ip> <server-port> This command is used by a client to login to the server located at ip address: <server-ip> listening on port: <server-port>. The LOGIN command takes 2 arguments. The first argument is the IP address of the server and the second argument is the listening port of the server. On successful registration, the server responds with: 1. List of all currently logged-in clients. The client should store this list for later display and use. 2. All the stored/buffered messages for this client in the order they were received at the server. Each of these messages will trigger an [EVENT]: Message Received, described at the end of this section. A client should not accept any other command, except LOGIN, EXIT, IP, PORT, and AUTHOR, or receive packets, unless it is successfully logged-in to the server. Notes You should NOT print the list of clients received as part of the output of the LOGIN command. The LOGIN SUCCESS/ERROR message should be printed after all the event related output (triggered by the buffered messages). Exceptions to be handled Invalid IP address/port number (e.g., 127.abc is an invalid IP; 43f is an invalid port). You can assume that a valid IP/port will always be the actual IP/listening port of the server. REFRESH Get an updated list of currently logged-in clients from the server. SEND <client-ip> <msg> Send message: <msg> to client with ip address: <client-ip>. <msg> can have a maximum length of 256 bytes and will consist of valid ASCII characters. Exceptions to be handled Invalid IP address. Valid IP address which does not exist in the local copy of the list of logged-in clients (This list may be outdated. Do not update it as a result of this check). BROADCAST <msg> Send message: <msg> to all logged-in clients. <msg> can have a maximum length of 256 bytes and will consist of valid ASCII characters. This should be a server-assisted broadcast. The sending client should send only one message to the server, indicating it is a broadcast. The server then forwards/relays this message to all the currently logged-in clients and stores/buffers the message for the others. Notes The client that executes BROADCAST should not receive the same message back. BLOCK <client-ip> Block all incoming messages (unicast and broadcast) from the client with IP address: <client-ip>. The client implementation should notify the server about this blocking. The server should not relay or store/buffer any messages from a blocked sender destined for the blocking client. The blocked sender, however, will be unaware about this blocking and should execute the SEND command without any error. Exceptions to be handled Invalid IP address. Valid IP address which does not exist in the local copy of the list of logged-in clients (This list may be outdated. Do not update it as a result of this check). Client with IP address: <client-ip> is already blocked. UNBLOCK <client-ip> Unblock a previously blocked client with IP address: <client-ip>. The client implementation should notify the server about the unblocking. Exceptions to be handled Invalid IP address. Valid IP address which does not exist in the local copy of the list of logged-in clients (This list may be outdated. Do not update it as a result of this check). Client with IP address: <client-ip> is not blocked. LOGOUT Logout from the server. However, your application should not exit and continue to accept LOGIN, EXIT, IP, PORT, and AUTHOR commands. In general, on LOGOUT all state related to this client is maintained on both the client and the server. Notes LOGOUT does NOT reset the statistic counters (see STATISTICS command in section 5.5). LOGOUT does NOT unblock any clients blocked by this client. LOGOUT does NOT change the blocked/unblocked status of this client on the server. EXIT Logout from the server (if logged-in) and terminate the application with exit code 0. This should delete all the state for this client on the server. You can assume that an EXITed client will never start again. [EVENT]: Message Received In the event of receipt of a message <msg> from a client with ip address: <client-ip>, print/log the message using the following format string: ("msg from:%s\n[msg]:%s\n", client-ip, msg) Note that <client-ip> here is the IP address of the original sender, not of the relaying server. For the purposes of printing/logging, use command_str: RECEIVED 5.7 BONUS: Peer-to-peer (P2P) file transfer Implement additional functionality to allow clients to send/receive files. Here, however, the transfer will take place directly between two clients and will not involve the server. For this, your implementation should establish a TCP connection between the two clients involved in a file transfer. The implementation does not need to handle any broadcast file transfers. All transfers will take place between a pair of clients. To send a file <file> residing in the same folder as the executable to a client with ip address: <client-ip>, a client would execute the following command: SENDFILE <client-ip> <file> The receiving client should store the file in the same folder as the executable, with the same name. Your implementation should be able to transfer both text and binary files. You can assume the maximum file size to be 10 MB. 6. Grading and Submission The grading will be done using automated tests. Any deviation from the output format/syntax described in previous sections will cause the tests to fail. For a detailed breakup of points associated with each command/functions, see https://goo.gl/UAVWgY For packaging and submission, see the section Packaging and Submission in https://goo.gl/L2kgb5 Published by Google Drive–Report Abuse–Updated automatically every 5 minutes