Tutorial by Examples

In a test you can disable animations by adding in setUp: app.launchEnvironment = ["animations": "0"] Where app is instance of XCUIApplication.
Lunch application for testing override func setUp() { super.setUp() let app = XCUIApplication() app.launch() } Terminating application func testStacOverFlowApp() { app.terminate() }
Snippet from MyExampleFile.xaml <TextBlock Foreground="{ThemeResource SystemControlBackgroundAccentBrush}" Text="This is a colored textbox that use the Accent color of your Windows 10"/> <TextBlock Foreground="{ThemeResource SystemControlBackgroundBa...
Snippet from MyExampleFile.xaml <TextBlock x:Name="MyTextBlock" Text="This is a TextBlock colored from the code behind"/> Snippet from MyExampleFile.xaml.cs // We use the application's Resource dictionary to get the current Accent of your Windows 10 ...
Device can be rotate by changing orientation in XCUIDevice.shared().orientation: XCUIDevice.shared().orientation = .landscapeLeft XCUIDevice.shared().orientation = .portrait
sample json to update { "student":{"name":"Rahul", "lastname":"sharma"}, "marks":{"maths":"88"} } To update the elements value in the json we need to assign the value and update. try { // Create a new in...
To compute the hashes of relatively small blocks of data using different algorithms: final MessageDigest md5 = MessageDigest.getInstance("MD5"); final MessageDigest sha1 = MessageDigest.getInstance("SHA-1"); final MessageDigest sha256 = MessageDigest.getInstance("SHA-256&...
if( function_exists('acf_add_options_page') ) { acf_add_options_page(); } Add the above code to functions.php and an options page named 'Options' will appear in your Wordpress admin area. You now need to asign some custom fields to the page.
if( function_exists('acf_add_options_page') ) { acf_add_options_page(array( 'page_title' => 'Theme General Settings', 'menu_title' => 'Theme Settings', 'menu_slug' => 'theme-general-settings', 'capability' => 'edit_posts', ...
<canvas id="c" width="400" height="400"></canvas> var canvas = new fabric.Canvas("c"); canvas.on('mouse:up', function () { console.log('Event mouse:up Triggered'); }); canvas.on('mouse:down', function () { console.log('Event mouse:d...
Aliases are named shortcuts of commands, one can define and use in interactive bash instances. They are held in an associative array named BASH_ALIASES. To use this var in a script, it must be run within an interactive shell #!/bin/bash -li # note the -li above! -l makes this behave like a login s...
<canvas id="c" width="400" height="400"></canvas> var canvas = new fabric.Canvas("c"); var text = new fabric.Textbox('Hello world From Fabric JS', { width:250, cursorColor :"blue", top:10, ...
To generate samples of cryptographically random data: final byte[] sample = new byte[16]; new SecureRandom().nextBytes(sample); System.out.println("Sample: " + DatatypeConverter.printHexBinary(sample)); Produces output similar to: Sample: E4F14CEA2384F70B706B53A6DF8C5EFE Note...
Performance testing is a subject/process/testing methodology but not a tool to setup. It includes the following core activities: Identify Test Environment Identify Performance Acceptance Criteria Plan and Design Tests Configure Test Environment Implement Test Design Execute Tests Analyze, ...
To generate key pairs using different algorithms and key sizes: final KeyPairGenerator dhGenerator = KeyPairGenerator.getInstance("DiffieHellman"); final KeyPairGenerator dsaGenerator = KeyPairGenerator.getInstance("DSA"); final KeyPairGenerator rsaGenerator = KeyPairGenerator...
It's a good idea to sanitize get_field() output, especially when using Advanced Custom Fields fields front end (with acf_form()). Otherwise your site is likely vulnerable to cross-site scripting attacks (XSS). The following function lets you use echo get_field_escaped('my_custom_field', $post_id, ...
Create In order to perform a Create operation via REST, you must perform the following actions: Create an HTTP request using the POST verb. Use the service URL of the list to which you want to add an entity as the target for the POST. Set the content type to application/json. Serialize the JSON...
To compute a signature: final PrivateKey privateKey = keyPair.getPrivate(); final byte[] data = "FOO BAR".getBytes(); final Signature signer = Signature.getInstance("SHA1withRSA"); signer.initSign(privateKey); signer.update(data); final byte[] signature = signer.sign();...
After you have a running cluster you can manage it with the kubectl command. Most of the commands you can get with the kubectl --help command, but I show you the most common commands, for manage and getting info about your cluster, nodes, pods, services and labels. For getting information about t...

Page 997 of 1336