Tutorial by Examples: l

Dependencies can be added for specific Build types: android { ... buildTypes { release { //... } debug { //.... } } } dependencies { debugCompile 'com.android.support:appcompat-v7:24.1.1' releaseCompile ...
Three main functions available (description from man pages): fromfile - A highly efficient way of reading binary data with a known data-type, as well as parsing simply formatted text files. Data written using the tofile method can be read using this function. genfromtxt - Load data from a t...
<!DOCTYPE html> <html> <head> <title>Styled Maps</title> <meta charset="utf-8"> <style> #map { height: 100%; } </style> </head> <body> <div id="map"></div> <script type="t...
As for any programming language, Ada comes with extensive libraries to accomplish various tasks. Here are some pointers to some of them, although searching on github will lead some more. The Ada runtime itself, distributed will all compilers, includes an extensive set of packages and annexes, r...
To compile a PHP extension in a typical Linux environment, there are a few pre-requisites: Basic Unix skills (being able to operate "make" and a C compiler) An ANSI C compiler The source code for the PHP extension you want to compile Generally there are two ways to compile a PHP ex...
data: lv_temp type string. data: ls_temp type sy. data: lt_temp type table of sy.
data: gv_temp type string. data: gs_temp type sy. data: gt_temp type table of sy.
Mocks are meant as test doubles, that allow interactions with the mocks to be validated, they are not meant to replace the system you are testing. Examples will often demonstrate features of Moq as follows: // Create the mock var mock = new Mock<IMockTarget>(); // Configure the mock to d...
An ActionResult can return FileContentResult by specifying file path and file type based from extension definition, known as MIME type. The MIME type can be set automatically depending on file type using GetMimeMapping method, or defined manually in proper format, e.g. "text/plain". Sinc...
User controls are made for reusability across ASP.NET pages, similar to master pages. Instead of sharing base page layout, user controls share group of HTML/ASP.NET built-in server controls or a specific form layout, e.g. comment submission or guest notes. A user control can contain both HTML contr...
If you want to instantiate an instance of user control inside ASPX code behind page, you need to write user control declaration on Page_Load event as follows: public partial class Default : System.Web.UI.Page { protected void Page_Load(Object sender, EventArgs e) { Control contr...
Like standard ASP.NET built-in server controls, user controls can have properties (attributes) on its definition tag. Suppose you want to add color effect on UserControl.ascx file like this: <uc:UserControl ID="UserControl1" runat="server" Color="blue" /> At t...
Where a method to be tested uses information from one call to pass on to subsequent calls, one approach that can be used to ensure the methods are called in the expected order is to setup the expectations to reflect this flow of data. Given the method to test: public void MethodToTest() { va...
When you can't / don't want to use Strict Mocks, you can't use MockSequence to validate call order. An alternate approach is to use callbacks to validate that the Setup expectations are being invoked in the expected order. Given the following method to test: public void MethodToTest() { _ut...
Moq provides support for validating call order using MockSequence, however it only works when using Strict mocks. So, Given the following method to test: public void MethodToTest() { _utility.Operation1("1111"); _utility.Operation2("2222"); _utility.Operation3(&...
Mocking an interface that inherits from IEnumerable to return canned data is quite straightforward. Assuming the following classes: public class DataClass { public int Id { get; set; } } public interface IEnumerableClass : IEnumerable<DataClass> { } The following approach can ...
Assume that we are using Page object model. Page Object class: import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public cla...
As an example of writing input & output, we'll take in a real value and return the value and its square until the user enters a negative number. As specified below, the read command takes two arguments: the unit number and the format specifier. In the example below, we use * for the unit number...
Given you've already installed composer up and running and it's accessible globally, you can simply create new Symfony projects as stated in the official documentation. Now you can create a new Symfony project with composer: composer create-project symfony/framework-standard-edition my_project_nam...
Listbox is a control that can contains collection of objects. Listbox is similar to Combobox but in Combobox; Only selected items are visible to user. In Listbox; all items are visible to user. How to add items to ListBox? private void Form3_Load(object sender, EventArgs e) { ...

Page 581 of 861