Tutorial by Examples: c

add_action( 'init', function() { // do something here } ); Using a function block to hook a set of instructions. With the init hook, the set of instructions will be executed right after wordpress has finished loading the necessary components.
function my_init_function() { // do something here } add_action( 'init', 'my_init_function' ); Using the name of the function to hook a set of instructions. With the init hook, the set of instructions will be executed right after wordpress has finished loading the necessary components. ...
class MyClass { static function my_init_method() { // do something here } } add_action( 'init', array( 'MyClass', 'my_init_method' ) ); Using a static method of a class to hook a set of instructions. With the init hook, the set of instructions will be executed right after w...
class MyClass { function my_init_method() { // do something here } } $obj = new MyClass(); add_action( 'init', array( $obj, 'my_init_method' ) ); Using a method of an object to hook a set of instructions. With the init hook, the set of instructions will be executed right...
switch (n % 2) { case 0: trace("n is even!"); case 1: trace("n is odd!"); default: trace("I don't know!"); } // Assigning the evaluated expression to a variable var message = switch (n % 2) { case 0: "n is even!"; case 1: "n ...
If different users need different datetime format then you may need to parse your incoming date string to actual date according to the format. In this case this snippet may help you. public class DateTimeBinder : DefaultModelBinder { public override object BindModel(ControllerContext control...
When the command-line syntax for an application is simple, it is reasonable to do the command argument processing entirely in custom code. In this example, we will present a series of simple case studies. In each case, the code will produce error messages if the arguments are unacceptable, and the...
This example shows how to use the Firebase Cloud Messaging(FCM) platform. FCM is a successor of Google Cloud Messaging(GCM). It does not require C2D_MESSAGE permissions from the app users. Steps to integrate FCM are as follows. Create sample hello world project in Android Studio Your Android...
This is a basic polymer element that show a list of names. <link rel="import" href="../bower_components/polymer/polymer.html"> <dom-module id="basic-list"> <template> <style> </style> <div>Name's list</div&g...
Professionally made web applications don't expose the internal details of the server environment to the user. When you place an order at your retailer, you don't see (or have to type) https://mydealer.com:8443/Dealerapp/entryPage.html, but just mydealer.com, although the app server needs all the det...
There are many ways to backup an Alfresco system. It is important that you backup the database as well as the content store. You may also want to back up the Solr indices. Assuming you installed using the binary installer, and everything lives in $ALRESCO_HOME, you can backup the database like this...
The StretchViewport is a Viewporttype, which supports a virtual screen size. This allowes you to define a fixed (resolution independent) width and height. The StretchViewport, as the name suggests, stretches the virtual screen, if the virtual aspect ratio does not match the real aspect ratio. The ...
content-model.xml : .... <constraints> <constraint name="my:aConstraintList" type="x.y.z.project.model.constraint.AConstraintList"> </constraint> .... <property name="my:aValue"> <title>My Value</title> <typ...
Scala's implementation of type classes is rather verbose. One way to reduce the verbosity is to introduce so-called "Operation Classes". These classes will automatically wrap a variable/value when they are imported to extend functionality. To illustrate this, let us first create a simple ...
A layout manager for templated views. Used within a ControlTemplate to mark where the content to be presented appears.
An element with a single content. ContentView has very little use of its own. Its purpose is to serve as a base class for user-defined compound views. XAML <ContentView> <Label Text="Hi, I'm a simple Label inside of a simple ContentView" HorizontalOptions="Center" ...
An element capable of scrolling if it's Content requires. ScrollView contains layouts and enables them to scroll offscreen. ScrollView is also used to allow views to automatically move to the visible portion of the screen when the keyboard is showing. Note: ScrollViews should not be nested. In a...
StackLayout organizes views in a one-dimensional line ("stack"), either horizontally or vertically. Views in a StackLayout can be sized based on the space in the layout using layout options. Positioning is determined by the order views were added to the layout and the layout options of the...
Open "Database Tool Window" if you don't have it opened: This what it looks like: Create new data source: By clicking on "+" icon: Or by opening "Data Sources and Drivers" dialog And adding new data source by clicking "+" there If you ...
Authentication in Django REST Framework can be configured globally as a subkey of the REST_FRAMEWORK variable in settings.py, just like the rest of the default framework configurations. REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.BasicAuthen...

Page 534 of 826