In application/hooks folder, create a file with name Blocker.php and paste the below code.
<?php
class Blocker {
function Blocker(){
}
/**
* This function used to block the every request except allowed ip address
*/
function requestBlocker(){
...
Android supports fingerprint api from Android 6.0 (Marshmallow) SDK 23
To use this feature in your app, first add the USE_FINGERPRINT
permission in your manifest.
<uses-permission
android:name="android.permission.USE_FINGERPRINT" />
Here the procedure to follow
...
Apache JMeter segregated all the components into following groups based on their functionality:
Test Plan: Starting point for scripting. JMeter saves the Test Plan in .jmx format. You add components to the Test Plan by Right Click on the Test Pand and navigating to the component you want to add.
...
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...
In a test you can disable animations by adding in setUp:
app.launchEnvironment = ["animations": "0"]
Where app is instance of XCUIApplication.
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.
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...
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();...
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...
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"...