Tutorial by Examples: st

We can use the get_bloginfo function to retrieve the email address of the site administrator. <?php echo get_bloginfo('admin_email'); ?>
For a non-main packages as well as main, instead of adding flags inside the code, write benchmarks in the test package , for example: func BenchmarkHello(b *testing.B) { for i := 0; i < b.N; i++ { fmt.Sprintf("hello") } } Then run the test with the profile flag ...
grant all privileges on schema_name.* to 'new_user_name'@'%' identified by 'newpassword'; Attention: This can be used to create new root user
request variables form url cgi
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 ...
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 ...
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'; ...
In this example, we will launch a basic EC2 Instance with Amazon Linux in the quickest manner possible via the AWS Management Console. Amazon frequently improves the user experience of the AWM Management console, so you might experience some changes to the screens below. Important: launching an in...
Using SBT to manage the library dependency, add this to build.sbt: libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.0" libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.0" % "test" More details can be f...
The subprocess method that allows running commands needs the command in form of a list (at least using shell_mode=True). The rules to create the list are not always straightforward to follow, especially with complex commands. Fortunately, there is a very helpful tool that allows doing that: shlex. ...
It's quite simple to install wordpress in MAMP. You have to follow a few simple steps: 1 - Download MAMP from here, it's free and you probably don't need the pro version. 2 - Install on your PC or Mac. 3 - Run the program -> you will see a little window open, from there you can set MAMP. At t...
Python allows you to hack list comprehensions to evaluate conditional expressions. For instance, [value_false, value_true][<conditional-test>] Example: >> n = 16 >> print [10, 20][n <= 15] 10 Here n<=15 returns False (which equates to 0 in Python). So what Python i...
SystemJS allows to write and use modular javacsript code that relies on ECMAScript 6 import and export statements. One good example is moment.js library, which started publishing ECMAScript 6 source code on npm since 2.10.0 release of moment.js. Installing prerequisites npm install moment npm ins...
var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var app = express(); app.use(favicon(__dirname + '/public/img/favicon.ico')); app.use(express.static(path.join(__dirname, 'public'))); app.listen(3000, function() { console.log("...
Install Java 8 from the Oracle website. (Optional) Install a Java build tool. Whether you choose to use Maven or Gradle, you normally don’t have to install anything, as JHipster will automatically install the Maven Wrapper or the Gradle Wrapper for you. If you don’t want to use those wrappers, ...
public class TestngAnnotation { // test case 1 @Test public void testCase1() { System.out.println("in test case 1"); } // test case 2 @Test public void testCase2() { System.out.println("in test case 2"); } @BeforeMethod pu...

Page 281 of 369