Tutorial by Examples

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();...
To get Nexus Repository Manager 2 running so you can use it with Maven, you need to run through a few steps before you install the repository manager itself. Download and install the Oracle JRE, version 7 or newer (suggest using version 8, because, duh). It can be obtained at the following link: ...
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...
An error is an error, one might wonder how could there be types in it. Well, with powershell the error broadly falls into two criteria, Terminating error Non-Terminating error As the name says Terminating errors will terminate the execution and a Non-Terminating Errors let the execution conti...
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...
When displaying labels on contours Matlab doesn't allow you to control the format of the numbers, for example to change to scientific notation. The individual text objects are normal text objects but how you get them is undocumented. You access them from the TextPrims property of the contour handl...
This is a sample HTTP client based on Ev extension. Ev extension implements a simple yet powerful general purpose event loop. It doesn't provide network-specific watchers, but its I/O watcher can be used for asynchronous processing of sockets. The following code shows how HTTP requests can be sche...
//integer (not really needed unless you need to round numbers, Excel with use default cell properties) worksheet.Cells["A1:A25"].Style.Numberformat.Format = "0"; //integer without displaying the number 0 in the cell worksheet.Cells["A1:A25"].Style.Numberformat.Form...

Page 1046 of 1336