Tutorial by Examples: c

In android, every developer uses Anonymous Class (Runnable) at least once in a project. Any Anonymous Class has a reference to its parent (activity). If we perform a long-running task, the parent activity will not be destroyed until the task is ended. Example uses handler and Anonymous Runnable cla...
Abstract Class : package base; /* Abstract classes cannot be instantiated, but they can be subclassed */ public abstract class ClsVirusScanner { //With One Abstract method public abstract void fnStartScan(); protected void fnCheckForUpdateVersion(){ System....
Navigate to project's app module and create libs directory. Place your .aar file there. For example myLib.aar. Add the code below to android block of app level's build.gradle file. repositories { flatDir { dirs 'libs' } } This way you defined a new ext...
Sometimes you would want to start or remove an action on a specific node at a certain time. For example, you might want to stop a moving object when the user taps the screen. This becomes very helpful when a node has multiple actions and you only wants to access one of them. let move = SKAction.mov...
package main import ( "fmt" "k8s.io/client-go/1.5/kubernetes" "k8s.io/client-go/1.5/pkg/api/v1" "k8s.io/client-go/1.5/rest" ) func main() { config, err = rest.InClusterConfig() if err != nil { return nil, err } ...
Objectives: Using the Spring CLI, we will create a new Spring Boot application to be deployed to Elastic Beanstalk. We will edit the generated Spring Boot application so that it will: Create a jar named aws-eb-demo.jar. Listen on port 5000. Include a single web page named index.html. ...
Code echo get_permalink( 44 ); Output The link of the post id:44, for example: http://website.com/category/name-of-post/
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( '<h1>', '</h1>' ); Output The title of the current post or page in h1 tags
Use dynamic_cast for converting pointers/references within an inheritance hierarchy. Use static_cast for ordinary type conversions. Use reinterpret_cast for low-level reinterpreting of bit patterns. Use with extreme caution. Use const_cast for casting away const/volatile. Avoid this unless you ar...
Code get_the_title( 44 ); Output The title of the post id:44.
Code <picture> <source media="(min-width: 600px)" srcset="large_image.jpg"> <source media="(min-width: 450px)" srcset="small_image.jpg"> <img src="default_image.jpg" style="width:auto;"> </picture> ...
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.
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, ...
After you have set a few data to database and have get a structure consisting of several nodes like this; "user" : { "-KdbKcU2ptfYF2xKb5aO" : { "firstName" : "Arthur", "lastName" : "Schopenhauer", "userName&q...
Create enum of custom errors enum RegistrationError: Error { case invalidEmail case invalidPassword case invalidPhoneNumber } Create extension of RegistrationError to handle the Localized description. extension RegistrationError: LocalizedError { public var errorDescription...
public function someAction(){ // Action's code return new Response($error, 500); } Another example: public function someAction(){ // Action's code $response = new Response(); $response->setStatusCode(500) $response->setContent($content); ...

Page 719 of 826