Tutorial by Examples: a

Regular expression matching is a powerful tool (in Java, and in other contexts) but it does have some drawbacks. One of these that regular expressions tends to be rather expensive. Pattern and Matcher instances should be reused Consider the following example: /** * Test if all strings in a lis...
Three basic tools. nginx - free, open-source, high-performance HTTP server and reverse proxy, with high performance; gunicorn - 'Green Unicorn' is a Python WSGI HTTP Server for UNIX (needed to manage your server); supervisor - a client/server system that allows its users to monitor and control ...
When invoking a def, parameters may be assigned explicitly by name. Doing so means they needn't be correctly ordered. For example, define printUs() as: // print out the three arguments in order. def printUs(one: String, two: String, three: String) = println(s"$one, $two, $three") ...
Command Structure is sqlcmd -S yourservername\instancename -d database_name -o outputfilename_withpath -Q "your select query" Switches are as follows -S for servername and instance name -d for source database -o for target outputfile (it will create output file) -Q fo...
When nothing matches a wildcard such as * in bash, it gets passed on as a literal * to the command, as if you had typed \*. However, zsh throws an error. Bash: duncan@K7DXS-Laptop-Arch:~/test$ echo *.txt *.txt duncan@K7DXS-Laptop-Arch:~/test$ touch abc.txt duncan@K7DXS-Laptop-Arch:~/test$ echo...
For BLE slave devices to do any useful work, the GPIOs of the wireless MCU are almost always involved. For instance, to read temperature from an external sensor, the ADC functionality of GPIO pins may be required. TI's CC2640 MCU features a maximum of 31 GPIOs, given different packaging types. In t...
Cordova plugins are in simple words a layer on top of the respective native platform. Plugins provide an interface between to access the native platform.
Cordova Plugins provide a common interface to interact with the native code. Each plugin has an intermediary JavaScript file that provides access to platform specific features.
cordova plugin add <plugin-name> Example: cordova plugin add cordova-plugin-camera The plugin should be installed in the root directory of the project. Note: Before adding the plugin replace the platform specific www folder content with the outer www folder in the root directory. Th...
cordova-plugin-battery-status - used for monitoring device's battery status. cordova-plugin-camera - provides an API for taking pictures and for choosing images from the system's image library. cordova-plugin-contacts - provides access to the device contacts database. cordova-plug...
It crops the images in square shape. This cordova project uses two plugins: Cordova Camera Plugin -- https://github.com/apache/cordova-plugin-camera Cordova Crop Image Plugin -- https://github.com/jeduan/cordova-plugin-crop The Camera plugin is combined with the Crop Image Plugin by ...
Pygame has a module, pygame.draw, that contains functions which can draw shapes directly to a Surface. FunctionDescriptionpygame.draw.rectdraw a rectangle shapepygame.draw.polygondraw a shape with any number of sidespygame.draw.circledraw a circle around a pointpygame.draw.ellipsedraw a round shape...
In pygame you usually use Surfaces to represent the appearance of objects, and Rectangles to represent their positions. A Surface is like a blank sheet of paper which contain colors or images. There are two ways to create a Surface: blank from scratch or by loading an image. Create a Surface To cr...
There are kinds 3 of transparency supported in pygame: colorkeys, Surface alphas, and per-pixel alphas. Colorkeys Makes a color fully transparent, or more accurately, making a color simply not be blit. If you have an image with a black rect inside you could set a colorkey to prevent the black colo...
You can set a variable to something with the eval() function by using something similar to the below code: var x = 10; var y = 20; var a = eval("x * y") + "<br>"; var b = eval("2 + 2") + "<br>"; var c = eval("x + 17") + "<br&...
This example implements a custom binding that toggles visibility (similar to the existing visible binding), but will utilize jQuery's fading API to animate the transition from visible to invisible. Custom binding definition: //Add a custom binding called "fadeVisible" by adding it as a p...
DIVIDE a INTO b c d Data item b, c, and d are changed as b/a, c/a and d/a. DIVIDE a INTO b GIVING c Data item c is changed as b/a. DIVIDE a BY b GIVING c Data item c is changed as a/b. DIVIDE a INTO b GIVING q REMAINDER r Data items q and r are set with results of b/a DIVIDE a BY b G...
DISPLAY "An error occurred with " tracked-resource UPON SYSERR DISPLAY A, B, C UPON CONSOLE DISPLAY group-data UPON user-device ON EXCEPTION WRITE device-exception-notice NOT ON EXCEPTION WRITE device-usage-log END-DISPLAY UPON CONSOLE is a default, ra...
EVALUATE a ALSO b ALSO TRUE WHEN 1 ALSO 1 THRU 9 ALSO c EQUAL 1 PERFORM all-life WHEN 2 ALSO 1 THRU 9 ALSO c EQUAL 2 PERFORM life WHEN 3 THRU 9 ALSO 1 ALSO c EQUAL 9 PERFORM disability WHEN OTHER PERFORM invalid END-EVALUATE
PERFORM VARYING counter FROM 1 BY 1 UNTIL counter > 10 IF debug-override THEN EXIT PERFORM IF counter = 5 THEN EXIT PERFORM CYCLE PERFORM some-miracle END-PERFORM

Page 777 of 1099