Tutorial by Examples: a

1. Go to File --> Settings (e.g. Ctrl+Alt+S ). 2. In the left-hand pane, select Plugins. 3. On the Plugins window, click "Install plugin from disk button". 4. Select the desired plugin from your local machine. Click Apply button of the Settings/Preferences dialog. O...
Registering a custom post type does not mean it gets added to the main query automatically. You need to use pre_get_posts filter to add custom post types to main query. // Show posts of 'post' and 'book' custom post types on home page add_action( 'pre_get_posts', 'add_my_post_types_to_query' ); ...
DIO streams are currently not recognized by the Event extension. There is no clean way to obtain the file descriptor encapsulated into the DIO resource. But there is a workaround: open stream for the port with fopen(); make the stream non-blocking with stream_set_blocking(); obtain numeric file...
For simple alert: Alert simpleAlert = driver.switchTo().alert(); String alertText = simpleAlert.getText(); System.out.println("Alert text is " + alertText); simpleAlert.accept(); For Prompt alert: Alert promptAlert = driver.switchTo().alert(); String alertText = promptAlert.getT...
You can add below hooks to add your own logo and link to replace default wordpress logo. To add custom logo function custom_login_logo() { echo '<style type="text/css"> h1 a { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.png) !important; backgro...
Download the files from CodePlex and add them to the project. Or install the files with the Package Manager. PM> Install-Package EPPlus
Explicit wait : Wait for a certain condition to occur before proceeding further in the code. WebDriver driver = new FirefoxDriver(); driver.get("http://google.com"); WebElement myElement = (new WebDriverWait(driver, 10)) .until(ExpectedConditions.presenceOfElementLocated(By.id("...
Found under Terminal > Preferences General In the general tab, you can chose which profile is opened when you start terminal. You can set "Shells open with" to chose which directory terminal opens to, or specify a command to run each time you open a new terminal window or tab. Profil...
Class under test: public class GreetingsService { // class to be tested in isolation private UserService userService; public GreetingsService(UserService userService) { this.userService = userService; } public String getGreetings(int userId, LocalTime time) { // the...
@Spy annotation (or method) can be used to partially mock an object. This is useful when you want to partially mock behavior of a class. E.g. Assume that you have a class that uses two different services and and you want to mock only one of them and use the actual implementation of the other service...
There are already implemented forms within Django to change the user password, one example being SetPasswordForm. There aren't, however, forms to modify the user e-mail and I think the following example is important to understand how to use a form correctly. The following example performs the foll...
In your class that is under test, you may have some private fields that are not accessible even through constructor. In such cases you can use reflection to set such properties. This is a snippet from such JUnit test. @InjectMocks private GreetingsService greetingsService = new GreetingsService();...
Once you've met the prerequisites for installing Nexus Repository Manager 3, you'll need to follow a few steps to get it running on Linux. Open a terminal Copy the package to a sane place sudo cp nexus-3.1.0-04-unix.tar.gz /usr/local cd /usr/local Untar the Nexus Repository Manager package via...
Once you've met the prerequisites for installing Nexus Repository Manager 3, you'll need to follow a few steps to get it running on Windows. Unzip the package, e.g. 7za.exe e nexus-3.1.0-04-win64.zip Copy the package to a sane place, likely C:\nexus Assuming you are using the command prompt a...
public class MergeSortBU { private static Integer[] array = { 4, 3, 1, 8, 9, 15, 20, 2, 5, 6, 30, 70, 60,80,0,9,67,54,51,52,24,54,7 }; public MergeSortBU() { } private static void merge(Comparable[] arrayToSort, Comparable[] aux, int lo,int mid, int hi) { for (int ...
This is a sample HTTP client class based on Event extension. The class allows to schedule a number of HTTP requests, then run them asynchronously. http-client.php <?php class MyHttpClient { /// @var EventBase protected $base; /// @var array Instances of EventHttpConnection protect...
In [1]: import pandas as pd import numpy as np In [2]: df = pd.DataFrame(np.random.choice(['foo','bar','baz'], size=(100000,3))) df = df.apply(lambda col: col.astype('category')) In [3]: df.head() Out[3]: 0 1 2 0 bar foo baz 1 baz bar baz 2 foo foo b...
Detailed instructions on getting rdf set up or installed.
As an example, lets us look at a Wordpress container The Dockerfile begins with FROM php:5.6-apache so we go to the Dockerfile abovementioned https://github.com/docker-library/php/blob/master/5.6/apache/Dockerfile and we find FROM debian:jessie So this means that we a security patch appears f...
As the last layer created by docker build -t mytag . showed ---> Running in d9a42e53eb5a You just launch the last created image with a shell and launch the command, and you will have a more clear error message docker run -it d9a42e53eb5a /bin/bash (this assumes /bin/bash is available, it ma...

Page 855 of 1099