Tutorial by Examples: c

In mysqld.cnf or equivalent: [mysql] prompt = '\u@\h [\d]> ' This achieves a similar effect, without having to deal with .bashrc's.
<?php if( get_field('text_field') ): ?> <?php the_field('text_field'); ?> <?php endif; ?> Here we use get_field() to determine if a value exists, and the_field() to echo it.
When creating the project You should check "Include UI Tests" in the project creation dialog. After creating the project If you missed checking UI target while creating project, you could always add test target later. Setps: While project open go to File -> New -> Target Fi...
When Accessibility enabled in Utilities Select storyboard. Expand the Utilities Select Identity Inspector Select your element on storyboard Add new Accessibility Identifier (in example addButton) When Accessibility disabled in Utilities Select storyboard. Expand the Utilities Select...
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
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(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...
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...
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...
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...
All needed usage shown with this snippet: #!/usr/bin/env bash declare -A assoc_array=([key_string]=value \ [one]="something" \ [two]="another thing" ...
The Longest Increasing Subsequence problem is to find subsequence from the give input sequence in which subsequence's elements are sorted in lowest to highest order. All subsequence are not contiguous or unique. Application of Longest Increasing Subsequence: Algorithms like Longest Increasing Subs...
public class LongestIncreasingSubsequence { private static int Lis(int[] input, int n) { int[] lis = new int[n]; int max = 0; for(int i = 0; i < n; i++) { lis[i] = 1; } for (int i = 1; i < n; i++) { ...

Page 620 of 826