Tutorial by Examples: a

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...
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...
All needed usage shown with this snippet: #!/usr/bin/env bash declare -A assoc_array=([key_string]=value \ [one]="something" \ [two]="another thing" ...
The Rabin–Karp algorithm or Karp–Rabin algorithm is a string searching algorithm that uses hashing to find any one of a set of pattern strings in a text.Its average and best case running time is O(n+m) in space O(p), but its worst-case time is O(nm) where n is the length of the text and m is the le...
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++) { ...
You can change the "$" delimiter to any other. The following example: from string import Template class MyOtherTemplate(Template): delimiter = "#" data = dict(id = 1, name = "Ricardo") t = MyOtherTemplate("My name is #name and I have the id: #id&quot...
Page.html <div data-bind="foreach: blogs"> <br /> <span data-bind="text: entryPostedDate"></span> <br /> <h3> <a data-bind="attr: { href: blogEntryLink }, text: title"></a> </h3> ...
Blog.html <div data-bind="visible: isLoading()"> Loading... </div> <div data-bind="visible: !isLoading(), foreach: blogs"> <br /> <span data-bind="text: entryPostedDate"></span> <br /> <h3> ...
QGraphics can be used to organize complicated scenes of visual objects into a framework that makes them easier to handle. There are three major types of objects used in this framework QGraphicsView, QGraphicsScene, and QGraphicsItems. QGraphicsItems are the basic visual items that exist in the scen...
In vbscript, an object doesn't necessarily need a designated type. Similar to C#'s var variable. Dim ExampleString1 As String Dim ExampleString2

Page 815 of 1099