Tutorial by Examples: er

Shortcode is a small piece of code that can be added into the WordPress editor and will output something different once the page is published or previewed. Frequently, shortcodes are added to the theme functions.php file, but that's not a good practice as shortcodes are expected to keep working aft...
Ideally, Prolog predicates can be used in all directions. For many pure predicates, this is also actually the case. However, some predicates only work in particular modes, which means instantiation patterns of their arguments. By convention, the most common argument order for such predicates is: ...
.git/hooks/pre-commit #!/bin/sh if [ -s pom.xml ]; then echo "Running mvn verify" mvn clean verify if [ $? -ne 0 ]; then echo "Maven build failed" exit 1 fi fi
Prior to C++17, template deduction cannot deduce the class type for you in a constructor. It must be explicitly specified. Sometimes, however, these types can be very cumbersome or (in the case of lambdas) impossible to name, so we got a proliferation of type factories (like make_pair(), make_tuple(...
To add a remote, use git remote add in the root of your local repository. For adding a remote Git repository <url> as an easy short name <name> use git remote add <name> <url> The command git fetch <name> can then be used to create and update remote-tracking branch...
Rename the remote named <old> to <new>. All remote-tracking branches and configuration settings for the remote are updated. To rename a remote branch name dev to dev1 : git remote rename dev dev1
Remove the remote named <name>. All remote-tracking branches and configuration settings for the remote are removed. To remove a remote repository dev: git remote rm dev
To list all configured remote repositories, use git remote. It shows the short name (aliases) of each remote handle that you have configured. $ git remote premium premiumPro origin To show more detailed information, the --verbose or -v flag can be used. The output will include the URL and th...
Create a basic application with single view application template with swift as language Add SWRevealViewController.h and SWRevealViewController.m then click on Create Bridging Header button and add #import "SWRevealViewController.h" on the Bridging header Then select viewControll...
LINQ provides a method that makes it easy to create a collection filled with sequential numbers. For example, you can declare an array which contains the integers between 1 and 100. The Enumerable.Range method allows us to create sequence of integer numbers from a specified start position and a num...
It's a good practice to cache loaded result to avoid multiple loading of same data. To invalidate cache onContentChanged() should be called. If loader has been already started, forceLoad() will be called, otherwise (if loader in stopped state) loader will be able to understand content change with ta...
Let's see MVP in action using a simple Login Screen. There are two Buttons—one for login action and another for a registration screen; two EditTexts—one for the email and the other for the password. LoginFragment (The View) public class LoginFragment extends Fragment implements LoginContract.Prese...
The CAEmitterLayer class provides a particle emitter system for Core Animation. The particles are defined by instances of CAEmitterCell. The particles are drawn above the layer’s background color and border. var emitter = CAEmitterLayer() emitter.emitterPosition = CGPoin...
For example we will create view that contains emitter layer and animates particles. import QuartzCore class ConfettiView: UIView { // main emitter layer var emitter: CAEmitterLayer! // array of color to emit var colors: [UIColor]! // intensity of appearance var ...
Demonstrate how to embed a lua interpreter in C code, expose a C-defined function to Lua script, evaluate a Lua script, call a C-defined function from Lua, and call a Lua-defined function from C (the host). In this example, we want the mood to be set by a Lua script. Here is mood.lua: -- Get versi...
You can add an image to a view's layer simply by using its contents property: myView.layer.contents = UIImage(named: "star")?.CGImage Note that the UIImage needs to be converted to a CGImage. If you wish to add the image in its own layer, you can do it like this: let myLayer = CA...
Basics There are a number of different transforms you can do on a layer, but the basic ones are translate (move) scale rotate To do transforms on a CALayer, you set the layer's transform property to a CATransform3D type. For example, to translate a layer, you would do something like this:...
You can test that a function throws an exception with the built-in unittest through two different methods. Using a context manager def division_function(dividend, divisor): return dividend / divisor class MyTestCase(unittest.TestCase): def test_using_context_manager(self): ...
void alertDialogDemo() { // get alert_dialog.xml view LayoutInflater li = LayoutInflater.from(getApplicationContext()); View promptsView = li.inflate(R.layout.alert_dialog, null); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( ...
String literals are used to specify arrays of characters. They are sequences of characters enclosed within double quotes (e.g. "abcd" and have the type char*). The L prefix makes the literal a wide character array, of type wchar_t*. For example, L"abcd". Since C11, there are ot...

Page 199 of 417