Tutorial by Examples: a

Server Application Session
variables this local arguments
attributes thisTag caller
Developers can use admin_bar_menu action to remove items from WordPress admin bar or toolbar. add_action('admin_bar_menu', 'remove_wp_logo_from_admin_bar', 999); function remove_wp_logo_from_admin_bar( $wp_admin_bar ) { $wp_admin_bar->remove_node('wp-logo'); } Above code removes WordPr...
You can also use Laravel Artisan commands from your routes or controllers. To run a command using PHP code: Artisan::call('command-name'); For example, Artisan::call('db:seed');
Badges are numerical indicators of how many items are associated with a link: Use the .badge class within <span> elements to create badges: <a href="#">News <span class="badge">5</span></a><br> <a href="#">Comments <span c...
Labels are used to provide additional information about something: Use the .label class, followed by one of the six contextual classes .label-default, .label-primary, .label-success, .label-info, .label-warning or .label-danger, within a <span> element to create a label: <h1>Example &...
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 ...
There are two kinds of persistent storage modes in Redis: AOF and RDB. To temporarily disable RDB execute the following commands on the Redis command line: config set save "" to temporarily disable AOF execute the following from the Redis command line: config set appendonly no The...
The following code will get the current configuration for the persistent storage state. These values can be modified dynamically, so they may differ from the configuration in redis.conf: # get config get appendonly config get save
It is simple to start using Redis using docker: docker pull redis docker run -p 6379:6379 --rm --name redis redis Now you have running instance on port 6397 Attention: All data will be deleted, when Redis will be stopped. To connect the redis-cli, start another docker: docker run -it --link ...
Before using gcov, source code should be compiled with gcc using the two flags, -fprofile-arcs and -ftest-coverage. This tells the compiler to generate the information and extra object file code required by gcov. gcc -fprofile-arcs -ftest-coverage hello.c Linking should also use the -fprofile-a...
To generate the coverage information the compiled program should be executed. When creating code coverage for a test suite this execution step will normally be performed by the test suite so that the coverage shows what parts of the program the tests executes and which they do not. $ a.out Execu...
You can find more info about Python Natural Language Toolkit (NLTK) sentence level tokenizer on their wiki. From your command line: $ python >>> import nltk >>> sent_tokenizer = nltk.tokenize.PunktSentenceTokenizer() >>> text = "This is a sentence. This is anothe...
You can use conditional operators in WordPress to enqueue scripts on specific pages of your Website. function load_script_for_single_post(){ if(is_single()){ wp_enqueue_script( 'some', get_template_directory_uri().'/js/some.js', array...
Since vim version 7.3 the feature 'persistent_undo' is supported, which makes it possible do undo/redo changes, even after closing vim or restarting your computer. It's possible to configure it by adding the following to your vimrc, but first create a directory, where your undofiles should be saved...
Here's an example on how to use ACF to output differently based on options (color selections in this case). While you can use <?php echo get_field('color_options'); ?> to output the value directly, you can also change the markup depending on the selection. <?php $option = get_field('color_...
data table; set table; label variable1 = 'label1' variable2 = 'label2' variable3 = 'label3'; run;
Custom formats, also known as user defined formats, can be created and used like any other default formats. /*Create new character format for state variables*/ PROC FORMAT; VALUE $statef 'CA' = 'California' 'MA' = 'Massachusetts' 'NY' = 'New York'; ...
/app/services/greeting.service.ts : import { Injectable } from '@angular/core'; import {greetingTypes,request,response} from './greeting.interface' @Injectable() export class Greeting{ private worker; constructor(){ this.worker = new Worker('../workers /gr...

Page 840 of 1099