Tutorial by Examples: f

To get OAuth2 access token simply do curl https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=myclientid" -d "client_secret=myclientsecret" -d "[email protected]" -d "password=mypassword123456" Y...
Code $categories = get_the_category(); foreach( $categories as $category ) { echo $category->name . '<br />'; } Output All names of categories of the current page, one on each line.
Code $categories = get_the_category(); foreach( $categories as $category ) { echo $category->term_id . '<br />'; } Output All ids of categories of the current page, one on each line.
Before you can build anything, you are required to make your machine ready for building. For this you need to install a lot of libraries and modules. The most recommended Linux distribution is Ubuntu, so this example will focus on installing everything that is needed on Ubuntu. Installing Java Fir...
Code the_title( ); Output The title of the current post or page
Code the_title( '<h1>', '</h1>' ); Output The title of the current post or page in h1 tags
Code get_the_title(); Output The title of the current post or page
Code get_the_title( 44 ); Output The title of the post id:44.
Code function add_new_style() { add_editor_style( 'file-name-here.css' ); } add_action( 'admin_init', 'add_new_style' ); Explanation In the above code, we used add_editor_style to load the css file. We also used add_action to make sure that WordPress runs our function.
add_theme_support( 'post-formats', array( 'formatone', 'formattwo' ) );
add_theme_support( 'post-thumbnails', array( 'post' ) ); The above code only allows post thumnails on all posts. To enable the feature on all post types, do: add_theme_support( 'post-thumbnails' );
In mathematics, especially Set Theory, we have a collection of things which is called set and we name those things as elements. We show a set with its name like A, B, C, ... or explicitly with putting its member on brace notation: {a, b, c, d, e}. Suppose we have an arbitrary element x and a set Z, ...
In this example, User Table will have a column that references the Agency table. CREATE TABLE agencies ( -- first create the agency table id SERIAL PRIMARY KEY, name TEXT NOT NULL ) CREATE TABLE users ( id SERIAL PRIMARY KEY, agency_id NOT NULL INTEGER REFERENCES agencies(id) DEFERR...
Sometimes, we want some fields in the JSON string to be optional. For example, data Person = Person { firstName :: Text , lastName :: Text , age :: Maybe Int } This can be achieved by import Data.Aeson.TH $(deriveJSON ...
In a data declaration, prefixing a type with a bang (!) makes the field a strict field. When the data constructor is applied, those fields will be evaluated to weak head normal form, so the data in the fields is guaranteed to always be in weak head normal form. Strict fields can be used in both rec...
Retrolambda lets you run Java 8 code with lambda expressions, method references and try-with-resources statements on Java 7, 6 or 5. It does this by transforming your Java 8 compiled bytecode so that it can run on an older Java runtime. Backported Language Features: Lambda expressions are back...
It is possible to use integer variables with latex. To create a new variable we need the \newcounter{name} command, where name is the name of the new counter. The name must contain only letters. This command creates a new one with name \thename. With this command we can print name variable onto the ...
C++17 The if constexpr statement can be used to conditionally compile code. The condition must be a constant expression. The branch not selected is discarded. A discarded statement inside a template is not instantiated. For example: template<class T, class ... Rest> void g(T &&p, Re...
One good reason to use Filters is for logging. Using this technique a REST call can be logged and timed easily. public class RestLogger implements ClientRequestFilter, ClientResponseFilter { private static final Logger log = LoggerFactory.getLogger(RestLogger.class); // Used for timing...
package com.test.ws.example; import javax.xml.soap.MessageFactory; import javax.xml.soap.MimeHeaders; import javax.xml.soap.SOAPBody; import javax.xml.soap.SOAPConnection; import javax.xml.soap.SOAPConnectionFactory; import javax.xml.soap.SOAPElement; import javax.xml.soap.SOAPEnve...

Page 396 of 457