Tutorial by Examples: check

Use the below command to check the replica set status. Command : rs.status() Connect any one of replica member and fire this command it will give the full state of the replica set Example : { "set" : "ReplicaName", "date" : ISODate("2016-09-26T07:3...
CHECK is a simple statement that evaluates a logical expression and exits the current processing block if it is false. METHOD do_something. CHECK iv_input IS NOT INITIAL. "Exits method immediately if iv_input is initial "The rest of the method is only executed if iv_input is not i...
ghci> :set -XOverloadedStrings ghci> import Data.Text as T isInfixOf :: Text -> Text -> Bool checks whether a Text is contained anywhere within another Text. ghci> "rum" `T.isInfixOf` "crumble" True isPrefixOf :: Text -> Text -> Bool checks whether a...
If you want to do different things based on the kind of error, use multiple rescue clauses, each with a different error type as an argument. def divide(x, y) begin return x/y rescue ZeroDivisionError puts "Don't divide by zero!" return nil rescue TypeError put...
You can use an else clause for code that will be run if no error is raised. def divide(x, y) begin z = x/y rescue ZeroDivisionError puts "Don't divide by zero!" rescue TypeError puts "Division only works on numbers!" return nil rescue => e ...
This is an example of using until/retries/delay to implement an alive check for a webapp that is starting up. It assumes that there will be some period of time (up to 3 minutes) where the webapp is refusing socket connections. After that, it checks the /alive page for the word "OK". It als...
XML <Deborah> <address>Dark world</address> <master>Babadi</master> <ID>#0</ID> <colour>red</colour> <side>evil</side> </Deborah> XPATH boolean(/Deborah/master/text()) OR string(/Deborah/master...
XML <Dobby> <address>Hogwartz</address> <master></master> <colour>wheatish</colour> <side>all good</side> </Dobby> XPATH boolean(/Dobby/master/text()) OR string(/Dobby/master) != '' OUTPUT false
The ConstainsKey method is the way to know if a key already exists in the Dictionary. This come in handy for data reduction. In the sample below, each time we encountner a new word, we add it as a key in the dictionary, else we increment the counter for this specific word. Dim dic As IDictionary(...
<?php if( get_field('my_field_name') ){ ?> <?php echo get_field('my_field_name'); ?> <?php }; ?> This will only show the field if content exists depending on content type (i.e., an image is uploaded to the field, text is entered, it is selected, etc.).
<?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.
To get a shorter version of the Null or Empty check, use an "= Nothing" comparison. Iif(Fields!UserEmail.Value = Nothing, "Null or Empty", "Not Null or Empty") The "= Nothing" will check simultaneously against Null or Empty, giving a more compact expressio...
yarn why package-name will identify why a package is installed and which other packages depend upon it. yarn why react
Mage::getSingleton('customer/session')->isLoggedIn()
Player playerToCheck; Player playerSeeing; boolean isVisible = playerSeeing.canSee(playerToCheck); //isVisible returns true if playerSeeing can see playerToCheck and false otherwhise
CI/CD pipeline Centralized authentication and authorization service API documentation API gateway Centralize log management tool Service monitor Infrastructure Automation Centralized config server
In spark-shell: sc.version Generally in a program: SparkContext.version Using spark-submit: spark-submit --version
If an integer x is a power of 2, only one bit is set, whereas x-1 has all bits set after that. For example: 4 is 100 and 3 is 011 as binary number, which satisfies the aforementioned condition. Zero is not a power of 2 and has to be checked explicitly. boolean isPowerOfTwo(int x) { return (x ...
Default WooCommerce checkout form comes with several fields for customers to enter their billing details. But in some cases, you might want to hide some of these fields. For example, if you are selling only virtual products, you can get rid of fields like billing address. Use the following code sn...
int[string] numbers = ["a" : 10, "b" : 20]; assert("a" in numbers); assert("b" in numbers); assert("c" in numbers);

Page 10 of 12