Tutorial by Examples

request variables form url cgi
Server Application Session
variables this local arguments
attributes thisTag caller
This function shortens the text to a specified number of words and returns the shortened text. <?php echo wp_trim_words( get_the_content(), 40, '...' ); ?> In the above example we are passing the post content to the function. It will restrict the length of the content to 40 words and will ...
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 ...
A basic script showing the fundamentals of how to create/open, write to, and save an Excel spreadsheet. Using the AutoIt Excel library functions. ; Include definitions of the User Excel functions #include <Excel.au3> ; Include Message Box codes for the error messages #include <MsgBox...
.class public auto ansi beforefieldinit Program extends [mscorlib]System.Object { .method public hidebysig static void Main() cil managed { .maxstack 8 IL_0000: nop IL_0001: ldstr "Hello World" IL_0006: call void [mscorlib]System.Console:...
Code coverage is a measure used to how often each source code statement and branch is executed. This measure is usually required when running a test suite to ensure that as much of the code as possible is tested by the test suite. It can also be used during profiling to determine code hot-spots and ...
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...
We can use the unit type as a function argument to define functions that we don't want executed until later. This is often useful in asynchronous background tasks, when the main thread may want trigger some predefined functionality of the background thread, like maybe moving it to a new file, or if...

Page 1027 of 1336